ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Weintraub <>
Subject Re: jar ant task
Date Tue, 26 Oct 2010 16:05:32 GMT
2010/10/25 codecook <>:
> OK,I have found a solution,sample file likes this :
> <jar destfile="${destJarPackage}" manifest="${buildDir}\META-INF\MANIFEST.MF">
> <fileset dir="${buildDir}"></fileset>
> </jar>

Is this a solution to your problem?

You can also use the <manifest> subtask to build the manifest for you.

<jar destfile="${destJarFile}"
    <fileset dir="${build.dir}"/>
       <attribute name="Release" value="${revision}"/>
       <attribute name="copyright" value="2010"/>
       <section name="Company Info">
          <attribute name="Company Name" value="${company}"/>
          <attribute name="License" value="${licenseURL}"/>

I find using the Manifest subtask a bit easier to maintain. People
sometimes forget about the Manifest file and the information in there
gets out of date. With the Manifest in the build.xml, it's easier to
see and more likely to be updated. Plus, you can calculate many of the
values dynamically (like keeping the copyright date up to date).

David Weintraub

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

View raw message