Creating builds with build version in ANT

Hi All,

We can generate builds with the build version information using ANT, All we have to do is to create a separte properties files, save it parallel to the Build.xml.

Step 1: Load the properties file from outside
<property file=””/> [inside the prop define key/value pair build_version=version 1.2.4]

Step 2: Specify the Vesrion information in the META-INF of the WAR/EAR using the below code.

<jar destfile=”build/war_name.war”>

<zipfileset dir=”${dist}”/>


<attribute name=”Built-By” value=”Date-${DATE_TIME}- Vesrion-${build_version}”/>



R Vashi

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.