ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Ellsworth <sc...@alodar.com>
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.

E.g.

<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.name}.jar"
         basedir="${build.dest}">
      <manifest>
        <attribute name="Main-Class" value="${jar.main-class}"/>
      </manifest>
      <zipfileset src="${jar.jdom}"/>
      <zipfileset src="${jar.parser}"/>
    </jar>
  </target>

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" />
and
<zipfileset src="${jar.includeset}"/>

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

Scott


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


Mime
View raw message