views:

145

answers:

4

How do you keep your build version number for a war file ?

in ant, in maven?

is there a way to simplify things?

also, how do you keep your change log? [ie so that version number could tell how newer version changed since the last build] ?

+1  A: 

I use SVN, this way I have access to all the changes, and also a global team version for the entire team (given by the svn commit version).

Adrian Pirvulescu
+2  A: 

We manage release numbers in Maven. We then use the maven release plugin to increment the version numbers when we need to release. This tool also insures that the changes are tagged in SVN. See: http://maven.apache.org/plugins/maven-release-plugin/index.html

When you perform a release with this tool the following steps are carried out:

* Check that there are no uncommitted changes in the sources
* Check that there are no SNAPSHOT dependencies
* Change the version in the POMs from x-SNAPSHOT to a new version (you will be prompted for the versions to use)
* Transform the SCM information in the POM to include the final destination of the tag
* Run the project tests against the modified POMs to confirm everything is in working order
* Commit the modified POMs
* Tag the code in the SCM with a version name (this will be prompted for)
* Bump the version in the POMs to a new value y-SNAPSHOT (these values will also be prompted for)
* Commit the modified POMs

These steps are sufficient for most release processes.

Pablojim
+1  A: 

ANT has a buildnumber task and Maven a build number plugin but ideally what you will want to do is setup a continuous integration environment that manages your builds. There are a few good continuous integration servers available, personally I really like working with Hudson. You would want to synchronise your build continuous server with your version control system. Each version control system is slightly different from one another but should all have a way of labeling or versioning your source. Hudson (like other continuous integration servers) has a number of plugins you can install for various tasks, these include source control

Ross
A: 

Ivy has a buildnumber task that calculates the build number from the modules already published into your repository.

Mark O'Connor