Rainer Noack wrote:

Both manifest entries are often used.
1) Class-path: lists "required" jars (typically if one application consists
of many jars).
Many classloaders evaluate this entry.

Yes, couldn't this be automagically generated? It seems to be made by hand in my project.

Is there a way in ant to merge the content of two manifest files?

The base one:

${build.basedir}/MANIFEST.MF

And the specific one with the class-path:
manifest="${build.metainf.dir}/${ear.module.name}/META-INF/MANIFEST.MF"

Because I don't think you can. :(


See sun's description of the extension mechanism for details.
You can manually add the designated jars to your classpath if there is a
reason
to not use this mechanism.

2) Main-Class: is used for the jar-version of running java.
(like: java myjar.jar)
(Afaik only available on windows)

Hope that helps

Rainer

-----Original Message-----
From: Kai Hendry [mailto:[EMAIL PROTECTED] Sent: Thursday, June 30, 2005 7:13 AM
To: Ant Users List
Subject: Manifestations


I'm tracking a project using a manifest in the basedir.
 <manifest file="${build.basedir}/MANIFEST.MF">
   <attribute name="Build-Master" value="${user.name}"/>
   <section name="common">
     <attribute name="Build-Version" value="${build.version}"/>
     <attribute name="Build-Number" value="${build.number}"/>
     <attribute name="Build-Date" value="${build.date}"/>
....

Then in each subproject I am adding manifest="${build.basedir}/MANIFEST.MF" to the jar tasks.

So far so good. Though how does one quickly check the manifest from Windows or any platform for that matter? Extract it and pull out the manifest? Is there some simple way to parse in the Build-Version into a running program?

One of the sub projects has an old manually edited MANIFEST.MF file with a Class-Path: and Main-Class: definitions. I thought this can't be serious. Can't Java/JAR files track their own classes by themselves? I don't see it on other JARs...

Manifest-Version: 1.0
Class-Path: jbossall-client.jar log4j.jar securityservice-ejb-client.jar commons-logging.jar xml-apis.jar ....
Main-Class: soltec.blah.blah.blah

So I removed them since two manifest lines (hoping they would merge) in the jar task didn't work. Though once testing this sub project, it seems to not work without this Main-Class and Class-path defined in the manifest!


Now, is that because it's hard coded into my source code or do Java programs really need these Class-Path defs in the manifest?

Shouldn't they be auto-generated if required?

And , is there a way of merging manifests in Ant?

Btw I am using Apache Ant version 1.6.4 compiled on May 19 2005

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



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



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

Reply via email to