You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by bo...@werken.com on 2003/03/14 03:14:04 UTC

[maven-bug] New comment: (MAVEN-334) Improve the content of the manifest file in archives

The following comment has been added to this issue:

     Author: Aslak Hellesøy
    Created: Thu, 13 Mar 2003 8:14 PM
       Body:
Spot-on!

I have actually just experienced the same problem. I'm using Maven to package a jar where some of the classes are Java Beans, so I specify my own manifest file (that Ant will merge into the Manifest specified in the jar plugin's jelly script).

My manifest file looks as follows:
---------------
Name: xdoclet/plugins/VelocityPlugin.class
Java-Bean: True
Name: xdoclet/plugins/JellyPlugin.class
Java-Bean: True
Name: xdoclet/XDoclet.class
Java-Bean: True
---------------

I specify this in project.properties:

---------------
# We're specifying our own MANIFEST.MF to be merged with the Manifest created by Maven.
# This MANIFEST.MF is created by the SDK and declares XDoclet classes that are
# Java beans. This is in order to support Java bean containers like IDEs.
maven.jar.manifest = ${maven.build.dest}/META-INF/MANIFEST.MF
---------------

And when I run the java:jar target I get this warning:

---------------
java:jar:
    [jar] Building jar: F:\cvs\xdoclet2\target\xdoclet-2.0-alpha-SNAPSHOT.jar
    [jar] Manifest warning: "Name" attributes should not occur in the main section and must be the first element in all other sections: "Name: xdoclet/plugins/VelocityPlugin.class"
    [jar] Manifest warning: "Name" attributes should not occur in the main section and must be the first element in all other sections: "Name: xdoclet/XDoclet.class"
    [jar] Manifest warning: "Name" attributes should not occur in the main section and must be the first element in all other sections: "Name: xdoclet/plugins/JellyPlugin.class"
---------------

The final manifest file looks as follows:

---------------
Manifest-Version: 1.0
Created-By: Apache Jakarta Maven
Built-By: Aslak Hellesøy
Package: xdoclet
Build-Jdk: 1.4.1_01

Name: xdoclet
Specification-Title: xdoclet
Specification-Version: 2.0-alpha-SNAPSHOT
Specification-Vendor: XDoclet Team
Implementation-Title: xdoclet
Implementation-Version: 2.0-alpha-SNAPSHOT
Implementation-Vendor: XDoclet Team

Name: xdoclet/plugins/VelocityPlugin.class
Java-Bean: True

Name: xdoclet/plugins/JellyPlugin.class
Java-Bean: True

Name: xdoclet/XDoclet.class
Java-Bean: True
---------------

Despite the warnings, it works fine. Java is still able to figure out my three Java Beans - java.beans.Introspector.getBeanInfo(XDoclet.class) does find the correct BeanInfo. -But it's clearly wrong to use

Name: xdoclet

It should be (as you point out) 

Extension-Name: xdoclet

Cheers,
Aslak
---------------------------------------------------------------------
View the issue:

  http://jira.werken.com/secure/ViewIssue.jspa?key=MAVEN-334


Here is an overview of the issue:
---------------------------------------------------------------------
        Key: MAVEN-334
    Summary: Improve the content of the manifest file in archives
       Type: Improvement

     Status: Assigned
   Priority: Minor

 Time Spent: Unknown
   Estimate: 2 hours

    Project: maven
  Component: plugin-java

   Assignee: Ben Walding
   Reporter: Ben Walding

    Created: Thu, 13 Mar 2003 7:18 PM
    Updated: Thu, 13 Mar 2003 7:18 PM

Description: