ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "webhiker@tiscali.fr" <webhi...@tiscali.fr>
Subject Re: Class-Path, Manifest.mf and Me
Date Mon, 26 May 2003 07:50:34 GMT
AFAIK the class-path attribute only applies to when you execute a file 
using the "java -jar <jar-file>"
These jars need to be placed relative to the jar you are executing. For 
packaging purposes I find it neater to use
<attribute name="Class-Path" value="lib/myjar.jar"/>

and copy all the jars into a lib directory in the same directory as my 
jar file.

Ant will probably (and rightly) ignore this attribute if the jar is 
included in a classpath.

WH

> Hi Everyone!
>
> I saw a neat trick in the Batik source where they have a single 
> batik.jar that contains nothing but a Manifest.mf file that adds the 
> other 7000 or so batik jars to the classpath.  So I decided to try it 
> myself, for the reduced number of jars I needed in my application:
>
> <target name="batik-jar">
>   <jar destfile="${lib}/batik/mybatik.jar">
>     <manifest>
>       <attribute name="Class-Path" value="batik-ext.jar batik-dom.jar 
> batik-css.jar batik-svg-dom.jar batik-gvt.jar batik-parser.jar [full 
> list trimmed]"/>
>     </manifest>
>   </jar>
> </target>
>
> The ant task runs fine, and gets me a jar with only a Manifest.mf 
> inside, with these contents:
>
> Manifest-Version: 1.0
> Class-Path: batik-ext.jar batik-dom.jar batik-css.jar batik-svg-dom.ja
>  r batik-gvt.jar batik-parser.jar batik-script.jar batik-bridge.jar ba
>  //etc
>
>
> Ok, the problem is that it doesn't work.  None of the classes in the 
> jars listed in the manifest are found.  When I add 'mybatik.jar' to my 
> classpath and recompile, everything barfs.
>
> Any idea what I'm doing wrong?
>
> - josh
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>



Mime
View raw message