您是否尝试过使用
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>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)