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:[EMAIL PROTECTED]] 
Sent: Monday, April 29, 2002 11:00 AM
To: [EMAIL PROTECTED]
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/
                                        [EMAIL PROTECTED]
-------

"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:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to