Ant 在jar内部从jar中删除/添加文件
基本上,我想从一个jar文件中删除文件并将文件添加到另一个jar文件中。在不完全提取jar文件并重新打包它们的情况下,这是可能的吗Ant 在jar内部从jar中删除/添加文件,ant,jar,add,delete-file,Ant,Jar,Add,Delete File,基本上,我想从一个jar文件中删除文件并将文件添加到另一个jar文件中。在不完全提取jar文件并重新打包它们的情况下,这是可能的吗 如果有蚂蚁脚本的话,那就太好了 在不完全提取jar文件并重新打包的情况下,这是可能的吗? - for addition / updation : Yes - for deletion : NO. however, instead of using the manual option, there's an alternative: <zip&g
如果有蚂蚁脚本的话,那就太好了
在不完全提取jar文件并重新打包的情况下,这是可能的吗?
- for addition / updation : Yes
- for deletion : NO.
however, instead of using the manual option, there's an alternative:
<zip>
<zipfileset/>
</zip>
<move/>
要在child.jar上执行的添加/删除操作
对于child.jar
上的任何操作,必须从parent.jar
中提取,无例外:
<unjar src="..\abc\parent.jar" dest="..\abc\temp">
<patternset includes="child.jar"/>
</unjar>
update=“true”
添加新文件并覆盖destfile
中已存在的文件
<zip destfile="..\abc\temp\child.jar" basedir="..\xyz\temp2" update="true"/>
-->要从.abc\temp\child.jar中删除文件,请执行以下操作:
<zip destfile="..\abc\temp\temp_child.jar">
<zipfileset src="..\abc\temp\child.jar" excludes="files_to_be_deleted" />
</zip>
<move file="..\abc\temp\temp_child.jar" toFile="..\abc\temp\child.jar"/>
可能重复的
<zip destfile="..\abc\temp\temp_child.jar">
<zipfileset src="..\abc\temp\child.jar" excludes="files_to_be_deleted" />
</zip>
<move file="..\abc\temp\temp_child.jar" toFile="..\abc\temp\child.jar"/>
<zip destfile="..\abc\parent.jar" basedir="..\abc\temp" update="true"/>