ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
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
one...

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}"
         update="true" 
         basedir="${classes}"
         includes="META-INF/MetaInfo.xml"
         manifest="${manifestfile}" />


-----Original Message-----
From: Gavin M. Bell [mailto:cue@6thcolumn.org] 
Sent: Monday, April 29, 2002 11:00 AM
To: ant-user@jakarta.apache.org
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
META-INF.

Thanks a million....

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

-- 



					Cue (UNIX SEMPI)
					     *DJ
					     *Skate/Snowboarder
					     *Teacher
					     *Gymnast
					     *Writer
					     *Entrepreneur
					     *Hacker
					     *Programmer
					     *System Administrator
					     *Lover
					     *All Around Groovy Cat:-)
					http://www.6thcolumn.org/~cue/
					cue@6thcolumn.org
-------

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

PGP KEY: http://www.6thcolumn.org/~cue/cuekey.asc

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

--
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