ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jon Skeet" <jon.sk...@peramon.com>
Subject RE: How to update a jar?
Date Wed, 09 May 2001 22:38:42 GMT
> 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}/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:

<move file="lib/myarchive.jar" tofile="lib/tmp.jar" />
<jar jarfile="lib/myarchive.jar" ... >
  <fileset dir="." includes="my/package/name/file.name" />
  <zipfileset src="lib/tmp.jar" includes="**" />
</jar>
<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
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

Mime
View raw message