Generating unique builds
As we have seen, we use a SNAPSHOT
version to specify that the project is under development. In the course of development, we will create several builds for the project. In many situations, it will be useful to distinguish one such build from another. One could be when we use continuous integration. Another would be when a tester needs to log defects against a build.
It would be nice if there was a way to generate a unique build number to identify a build in the case of SNAPSHOT
versions.
How to do it...
- Open the project for which you want to have a build number (
project-with-build-number
). - Add the following plugin configuration:
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>buildnumber-maven-plugin</artifactId> <version>1.3</version> <executions> <execution> <phase>validate</phase> <goals> <goal>...