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