ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Ellsworth <>
Subject Re: Using Main-Class and Class-Path in a manifest file
Date Wed, 13 Mar 2002 00:41:42 GMT

On Tuesday, March 12, 2002, at 04:07  PM, Todd Wilson wrote:

> It's not an absolute necessity for us to include everything in a single 
> jar file, but it is a convenience.  In the jar spec it seems to hint at 
> the fact that you can do this, though I'm inferring that.

The best way to do what you likely want is to include the log4j classes 
inside your own zip, unzipping them as needed.  This will undo any 
signing they may have done, but it will likely work.


<property name="jar.jdom" value="${compile.libdir}/jdom.jar" />
<property name="jar.parser" value="${compile.libdir}/crimson.jar" />
<target name="package" depends="compile">
    <jar jarfile="${build.dir}/${}.jar"
        <attribute name="Main-Class" value="${jar.main-class}"/>
      <zipfileset src="${jar.jdom}"/>
      <zipfileset src="${jar.parser}"/>

Note: I am given to understand that 1.5b versions will allow an honest 
to God fileset to be sent to the src attribute of a zipfileset, so one 
could do:

<property name="jar.includeset" 
value="${compile.libdir}/jdom.jar,${compile.libdir}/crimson.jar" />
<zipfileset src="${jar.includeset}"/>

so your tasks can be far more modular about this inclusion.


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message