ant任务从jar中删除文件

ant任务从jar中删除文件,第1张

ant任务从jar中删除文件

您是否尝试过使用

zipfileset
任务?

<jar destfile="stripped.jar">    <zipfileset src="full.jar" excludes="files/to/exclude*.file"/></jar>

例如:

<property name="library.dir" value="dist"/><property name="library.file" value="YourJavaArchive.jar"/><property name="library.path" value="${library.dir}/${library.file}" /><property name="library.path.new" value="${library.dir}/new-${library.file}"/><target name="purge-superfluous">    <echo>Removing superfluous files from Java archive.</echo>    <jar destfile="${library.path.new}">        <zipfileset src="${library.path}" excludes="**/ComicSans.ttf"/>    </jar>    <delete file="${library.path}" />    <move file="${library.path.new}" tofile="${library.path}" /></target>


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5429113.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-11
下一篇 2022-12-11

发表评论

登录后才能评论

评论列表(0条)

保存