Tuesday, September 15, 2009

Build numbers & release dates with Maven

Having the build date & build number is a common requirement in any build system. Often, documents such as release notes & readme files need to contain this information. If your project uses Maven 2.x, here is how you do it.

1. Add the plugin repository

<name>TLC Repository</name>

2. Add the plugin to the product distributions POM

<format>{0,date,dd MMM yyyy}</format>

3. Where ever you use the release date, use the ${buildNumber} property

4. That is it!
Post a Comment