Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I modify a file in a jar file using ANT?

Tags:

jar

ant

I need to update an XML file that's inside of a jar file using ANT. I have to search for a string in the file and replace it with another value if that string exists.

like image 238
Justin Kredible Avatar asked Jan 19 '11 16:01

Justin Kredible


1 Answers

A crude approach. Unzip the jar file, use the replace ant task, zip the files again and put the jar file back.

  • Task: copy
  • Task: unzip
  • Task: replace
  • Task: zip
  • Task: move
like image 134
miku Avatar answered Oct 22 '22 16:10

miku