Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@jakarta.apache.org Received: (qmail 91813 invoked by uid 500); 9 May 2001 22:46:48 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: ant-user@jakarta.apache.org Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 91801 invoked from network); 9 May 2001 22:46:45 -0000 Message-ID: From: Aarti Chandnani To: "'ant-user@jakarta.apache.org'" Subject: RE: How to update a jar? Date: Wed, 9 May 2001 15:44:41 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C0D8D9.A2C53570" X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C0D8D9.A2C53570 Content-Type: text/plain; charset="iso-8859-1" use zip task instead its like jar but doesnt create the manifest file! -----Original Message----- From: Jon Skeet [mailto:jon.skeet@peramon.com] Sent: Wednesday, May 09, 2001 3:39 PM To: ant-user@jakarta.apache.org Subject: RE: How to update a jar? > I'm trying to update a jar file with a different manifest. > Therefore, I > have the following code: > > manifest="${jar.dest}/Manifest.mf" > compress="true" > /> > > At the time that this piece of code gets run, the jar file is already > created. Afterwards, the only thing in the jar file is the > manifest. In > other words, the above over-wrote my original jar file. This > is not what I > was hoping for. > > How do I update a jar file? I basically want to do the > equivalent of a "jar > -u" command. I asked the same question just recently - and it turns out there isn't really a nice way round it. You can do something like: but it isn't terribly satisfactory. As this is at least the third time it's been asked (and is actually all that's really keeping me from using Ant for the build procedures at work), I may have a look into it and see whether I can't come up with a patch... Jon ------_=_NextPart_001_01C0D8D9.A2C53570 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable RE: How to update a jar?

use zip task instead
its like jar but doesnt create the manifest file! =

-----Original Message-----
From: Jon Skeet [mailto:jon.skeet@peramon.com]<= /FONT>
Sent: Wednesday, May 09, 2001 3:39 PM
To: ant-user@jakarta.apache.org
Subject: RE: How to update a jar?


> I'm trying to update a jar file with a different = manifest. 
> Therefore, I
> have the following code:
>
>         = <jar = jarfile=3D"${jar.dest}/services/framework/client.jar"
>          = ;   manifest=3D"${jar.dest}/Manifest.mf"
>          = ;   compress=3D"true"
>         = />
>
> At the time that this piece of code gets run, = the jar file is already
> created.  Afterwards, the only thing in = the jar file is the
> manifest.  In
> other words, the above over-wrote my original = jar file.  This
> is not what I
> was hoping for.
>
> How do I update a jar file?  I basically = want to do the
> equivalent of a "jar
> -u" command.

I asked the same question just recently - and it = turns out there
isn't really a nice way round it. You can do = something like:

<move file=3D"lib/myarchive.jar" = tofile=3D"lib/tmp.jar" />
<jar jarfile=3D"lib/myarchive.jar" ... = >
  <fileset dir=3D"." = includes=3D"my/package/name/file.name" />
  <zipfileset src=3D"lib/tmp.jar" = includes=3D"**" />
</jar>
<delete file=3D"lib/tmp.jar" = />

but it isn't terribly satisfactory. As this is at = least the third time
it's been asked (and is actually all that's really = keeping me from using
Ant
for the build procedures at work), I may have a look = into it and see
whether
I can't come up with a patch...

Jon

------_=_NextPart_001_01C0D8D9.A2C53570--