ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aarti Chandnani <>
Subject RE: How to update a jar?
Date Wed, 09 May 2001 22:44:41 GMT
use zip task instead
its like jar but doesnt create the manifest file! 

-----Original Message-----
From: Jon Skeet []
Sent: Wednesday, May 09, 2001 3:39 PM
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="${jar.dest}/services/framework/client.jar"
>             manifest="${jar.dest}/"
>             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:

<move file="lib/myarchive.jar" tofile="lib/tmp.jar" />
<jar jarfile="lib/myarchive.jar" ... >
  <fileset dir="." includes="my/package/name/" />
  <zipfileset src="lib/tmp.jar" includes="**" />
<delete file="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
for the build procedures at work), I may have a look into it and see
I can't come up with a patch...


View raw message