ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <>
Subject RE: How do I Put a file into a Jar's META-INF directory?
Date Tue, 30 Apr 2002 14:39:41 GMT
Must have missed the answers to Gavin's actual questions... The doc says you
simply have to use the <metainf> sub-element of <jar>. The doc isn't clear
on the other hand whether the files end up in META-INF directly (are
flattened in META-INF basically), or if the relative path to the <fileset>'s
dir is preserved. Would have to experiment (another time) to answer that

I personally just copy or generate the files I want in a directory called
META-INF in the classes/ dir (where classes are generated), and simply
includes these files for JARing. This has the added advantage that these
files can be found as resources whether I run my app off the classes/ dir or
the JAR (composed of the classes in classes/).

    <!-- generate metainfo file from JAR-->

    <mkdir dir="${classes}/META-INF" />
    <copy file="${metainfo}"
          tofile="${classes}/META-INF/MetaInfo.xml" />

    <jar jarfile="${jarfile}"
         manifest="${manifestfile}" />

-----Original Message-----
From: Gavin M. Bell [] 
Sent: Monday, April 29, 2002 11:00 AM
Subject: How do I Put a file into a Jar's META-INF directory?

Hello All, 

I am looking for a way to put a file that I have into a newly created
Jar's META-INF directory.  Is there a way using the "JAR" task that I 
can specify a file to put into META-INF?

The goal is the build the JAR stuffed with the files I want into

Thanks a million....

I notice there are undocumented tags etc with the JAR task... any other
would be apprecitaed. (i.e. <manifest> etc...)


					Cue (UNIX SEMPI)
					     *System Administrator
					     *All Around Groovy Cat:-)

"I'm trying real hard to be the shepherd."
				-Samuel Jackson (Pulp Fiction)


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

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

View raw message