Thursday, December 15, 2011

ANT: Appending a file to a jar/war/zip

Just use the update="true" attribute
Example :
<jar destfile="${project.deploy.location}/${}.${project.type}" update="true">
  <zipfileset file="deploy/META-INF/" prefix="META-INF/"/>

  destfile - the jar file you want to add to
    project.type - this can be war/zip/ear etc the name of your artifact
    project.deploy.location the location of your artifact

  file- the file you want to add to your jar
  prefix - the prefix/location for this file inside the jar

No comments:

Post a Comment