ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rainer Noack" <rai...@noacks.net>
Subject RE: Manifestations
Date Thu, 30 Jun 2005 19:58:39 GMT
Hi Kai,
this is not really the correct list for this question.
however, the answer is pretty simple.
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.
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:hendry@soltecsoftware.com.au] 
> 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: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message