DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29731>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29731

jar task 'filesetmanifest="mergewithoutmain"' only working on manifest files

           Summary: jar task 'filesetmanifest="mergewithoutmain"' only
                    working on manifest files
           Product: Ant
           Version: 1.6.1
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Core tasks
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Consider the following task:

  <jar destfile="${ant.project.name}.jar" filesetmanifest="mergewithoutmain">
    <manifest>
      <attribute name="Implementation-Title" value="AntTest" />
      <attribute name="Implementation-Vendor" value="Day Software AG" />
      <attribute name="Implementation-Version" value="1.0 (build ${DSTAMP})" />
    </manifest>
    <zipgroupfileset dir=".">
      <include name="jar1.jar"/>
      <include name="jar2.jar"/>
    </zipgroupfileset>
  </jar>

The expected behaviour according to documentation is that the manifests
contained in the jar1.jar and jar2.jar files are merged into the manifest of the
target jar file except for the main section.

Given the manifest from jar1.jar
-------------------------------------------------------------
Manifest-Jar1: This is the MAIN part of jar1's Manifest

Name: jar1
SomeProperty: Property of Jar1
-------------------------------------------------------------

And the manifest from jar2.jar
-------------------------------------------------------------
Manifest-Jar2: This is the MAIN part of jar2's Manifest

Name: jar2
SomeProperty: Property of Jar2
-------------------------------------------------------------

The resulting manifest in the target jar file is expected to be
-------------------------------------------------------------
Manifest-Version: 1.0
Implementation-Title: AntTest
Implementation-Vendor: Day Management AG
Implementation-Version: 1.0 (build ${DSTAMP})

Name: jar1
SomeProperty: Property of Jar1

Name: jar2
SomeProperty: Property of Jar2
-------------------------------------------------------------

While the actual manifest in the target jar file is
-------------------------------------------------------------
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.1
Created-By: 1.4.2_04 (Sun Microsystems Inc.)
Manifest-Jar1: This is the MAIN part of jar1's Manifest
Manifest-Jar2: This is the MAIN part of jar2's Manifest
Implementation-Title: AntTest
Implementation-Vendor: Day Management AG
Implementation-Version: 1.0 (build ${DSTAMP})

Name: jar1
SomeProperty: Property of Jar1

Name: jar2
SomeProperty: Property of Jar2
-------------------------------------------------------------

On the other hand, if the target jar file manifest is specified to come from a
manifest file instead of a contained <manifest> element, merging works as
expected ignoring the Main sections of the jar1.jar and jar2.jar files.

Looking at the source of the manifest creation in the Jar task class (method
createManifest()) reveals, that the configured manifest's main section is merged
into the original and zipfileset manifest main sections and only the defined
manifest file's main section may overlay the merged Main sections.

I assume this is a problem as the configured manifest Main section should be
treated the same as the Main section from a manifest file.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to