You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Eric Dantec <er...@laposte.net> on 2004/01/21 23:47:38 UTC
Manifest file
Hi all,
I use Ant 1.4.3 and I have an issue while running a build.xml file.
I have a project called "type". In this directory there are :
- *.java files
- build.xml file
- MANIFEST.MF file
I want to create a jar file with the class files and the updated MANIFEST.MF.
The jar is created and it contains :
- the class files
- the original MANIFEST.MF file
- and : a directory called "meta-inf" that contains the new MANIFEST.MF
What I want to do is updating the existing manifest file, not creating a new one in a different directory.
So here is the code of my build file :
<target name="jar" depends="main">
<jar destfile="${JARDIR}/type.jar" basedir=".">
<fileset dir="${CLASSDIR}" includes="com/lawson/rdtech/${ant.project.name}/*.class" />
<fileset dir="${SRCDIR}" includes="com/lawson/rdtech/${ant.project.name}/LEAF_NODE" />
<manifest file="MANIFEST.MF" mode="update">
<attribute name="Built-By" value="${user.name}"/>
<section name="com/lawson/rdtech/type">
<attribute name="Specification-Title" value="whatever"/>
<attribute name="Specification-Version" value="whatever"/>
<attribute name="Specification-Vendor" value="whatever"/>
<attribute name="Implementation-Version" value="whatever"/>
<attribute name="Implementation-Vendor" value="whatever"/>
</section>
</manifest>
</jar>
</target>
When I run it, I have an error that says that "Class org.apache.tools.ant.taskdefs.Manifest doesn't support the 'file' attribute".
So I can I fix that? Is there another mean to update an existing manifest file?
Thanks,
Eric
Re: Manifest file
Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
On Thu, 22 Jan 2004 09:47 am, Eric Dantec wrote:
> When I run it, I have an error that says that "Class
> org.apache.tools.ant.taskdefs.Manifest doesn't support the 'file'
> attribute". So I can I fix that? Is there another mean to update an
> existing manifest file?
>
You are using a <manifest> element embedded in a <jar> task. This is designed
to generate a manifest inline without requiring a manifest file.
If you want to manipulate manifest files you use the <manifest> task. i.e.
don't stick it in the <jar> task. It will then accept a file attribute and
you can update the manifest file. You can use the resulting file in a jar
using the <jar> tasks manifest attribute.
Conor
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org