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=”build.properties”/> [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}”/>

<manifest>

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

</manifest>

</jar>

Thanks
R Vashi

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s