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

2019-01-26 12:47发布

问题:

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.

回答1:

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


标签: ant jar