• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Manifest destiny!

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone,

My problem is with creating a Manifest file in Ant. I require a completely unique manifest.mf file in my meta-inf folder.

Ant, by default creates this "manifet.mf" file:

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.5.4
Created-By: 1.3.1_09-b03 (Sun Microsystems Inc.)

My deploy tool breaks unless the "manifest.mf" looks exactly like this:

Manifest-Version: 1.0
Implementation-Title: scem
Specification-Vendor: SAP AG
Implementation-Vendor-Id: sap.com
Implementation-Version: 2006.06.12.10.34.23

Here's what i'm doing:

<manifest file="${scem.dir}/META-INF/MANIFEST.MF" mode="replace">
<attribute name="Manifest-Version" value="1.0"/>
<attribute name="Implementation-Title" value="scem"/>
<attribute name="Specification-Vendor" value="SAP AG"/>
<attribute name="Implementation-Vendor-Id" value="sap.com"/>
<attribute name="Implementation-Version" value="2006.06.12.10.34.23"/>
</manifest>

<!-- Creates the .ear file -->
<jar jarfile="${war.dir}/${conPropDir}/${war.filename}.ear" manifest="${scem.dir}/META-INF/MANIFEST.MF">
<fileset dir="${war.dir}/${conPropDir}" includes="${war.filename}.war" />
<fileset dir="${scem.dir}" includes="META-INF/*.xml" />
</jar>

Unfortunately, the result is contcatenatation of the two to creat his "Manifest.mf":

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.5.4
Created-By: 1.3.1_09-b03 (Sun Microsystems Inc.)
Implementation-Title: z_scem
Specification-Vendor: SAP AG
Implementation-Vendor-Id: sap.com
Implementation-Version: 2006.06.12.10.34.23


Please help!

thanks
 
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think that says something bad about your deploy tool, but one way around this problem is to build up your manifest.mf file by hand and use the zip task instead of the jar task. All a JAR is is a zipfile with a manifest in it, so the JAR task adds one for you.
 
waluigi johnson
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tim,

Thanks for the reply. Unfortunately the deploy tool is from SAP.. and I cannot change it in any way!

I made the change to the build.xml like you suggested:

<!-- Creates the .ear file -->
<zip zipfile="${war.dir}/${conPropDir}/${war.filename}.ear">
<fileset dir="${war.dir}/${conPropDir}" includes="${war.filename}.war" />
<fileset dir="${scem.dir}" includes="META-INF/*.xml" />
<fileset dir="${scem.dir}" includes="META-INF/*.mf" />
</zip>

and believe it or not it, it still added the ANT header's to the resulting Manifest file. I believe anything that's added as meta-inf/manifest.mf, be it with the jar or zip task, is still modified by Ant. Perhaps there is another way to manually add a file using zip?
 
author & internet detective
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Waluigi,
Welcome to JavaRanch!

I did this by creating the jar the way Ant wanted to and then using the update attribute of <jar> to overwrite the manifest with the one I wanted.

[fix typo in html &lt;]
[ June 15, 2006: Message edited by: Jeanne Boyarsky ]
 
waluigi johnson
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got it working! Thanks for your help Jeanne.

Regards,
WJ
 
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We are facing the same issue with deploying and EAR to SAP. Could anyone share the solution (build) you used to remove the Ant generated lines in the manifests?
 
Tim Holloway
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You guys need to yell at your vendors! From the Sun documentation:


Attributes which are not understood are ignored. Such attributes may include implementation specific information used by applications.



From http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html#JAR%20Manifest

In the mean time, I don't see any options in Ant to keep it from adding its audit info, so that leaves you using the ZIP task in place of JAR, WAR, and EAR until your vendor gets with the spec.
 
reply
    Bookmark Topic Watch Topic
  • New Topic