Home Navigation

Thursday 6 October 2016

Some useful ant commands

Delete files inside a zip/jar/war/ear:

<project name="myproject">
<target name="updateZip">
<zip destfile="updatedZip.zip">
<zipfileset src="baseZipFromWhereToDelete.zip" excludes="path1,path2" />
</zip>
</target>
</project>

Inject/update some content inside zip/jar/war/ear:

<project name="myproject">
<target name="updateZip">
<zip update="true" destfile="theFileNeedsToBeUpdated.zip" baseDir="TheContentWhichWillBeIjected" />
</target>
</project>

How to compress/zip a set of files:

<zip destfile="TheZipFileNameWhichWillBeCreated.zip" basedir="TheContentWhichAreGoingToBeCompressed" />

No comments:

Post a Comment