You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by codecook <co...@163.com> on 2010/10/26 03:50:05 UTC

jar ant task

Hi,All
Could anyone tell me how can I assign an exsiting manifest file to the jar task?


Thanks 

Re: jar ant task

Posted by David Weintraub <qa...@gmail.com>.
2010/10/25 codecook <co...@163.com>:
> 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}"/>
    <manifest>
       <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}"/>
       </section>
     </manifest>
</jar>

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
qazwart@gmail.com

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


Re:jar ant task

Posted by codecook <co...@163.com>.
OK,I have found a solution,sample file likes this :
<jar destfile="${destJarPackage}" manifest="${buildDir}\META-INF\MANIFEST.MF">
<fileset dir="${buildDir}"></fileset>
</jar>



At 2010-10-26 09:50:05,codecook <co...@163.com> wrote:

>Hi,All
>Could anyone tell me how can I assign an exsiting manifest file to the jar task?
>
>
>Thanks