Book Image

Apache Maven Cookbook

By : Raghuram Bharathan
Book Image

Apache Maven Cookbook

By: Raghuram Bharathan

Overview of this book

If you are a Java developer or a manager who has experience with Apache Maven and want to extend your knowledge, then this is the ideal book for you. Apache Maven Cookbook is for those who want to learn how Apache Maven can be used for build automation. It is also meant for those familiar with Apache Maven, but want to understand the finer nuances of Maven and solve specific problems.
Table of Contents (13 chapters)
12
Index

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...

  1. Open the project for which you want to have a build number (project-with-build-number).
  2. 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&gt...