Kamal
Kamal

Reputation: 11

Ant script to modify a jar

Is there a way I can modify a file in a jar using ant script. Like, I have a x.properties in a y.jar. I want to edit this x.properties and put it back into the y.jar using ant script. Is this possible?

Upvotes: 1

Views: 1448

Answers (2)

FrankB
FrankB

Reputation: 1

I usually unpack the whole jar file, alter the file I want to alter, and then create a new jar file. I is probably not the fasted way, but my build scrips are not time critical.

Upvotes: 0

Rahul
Rahul

Reputation: 13056

jar -xvf <filename> extracts a file out of a jar.

jar -uvf <filename> can update a file in the jar.

You can use a script to do this and then use Ant to call the script.

Upvotes: 0

Related Questions