I want to have a build number for my maven project.
I used the following configuration in pom.xml:
<!-- build number -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
<configuration>
<doCheck>false</doCheck>
<doUpdate>false</doUpdate>
</configuration>
</plugin>
</plugins>
<finalName>${project.artifactId}-${project.version}-r${buildNumber}</finalName>
</build>
<!-- dummy scm for build number plugin -->
<scm>
<connection>scm:git:http://127.0.0.1/dummy</connection>
<developerConnection>scm:git:https://127.0.0.1/dummy</developerConnection>
<tag>HEAD</tag>
<url>http://127.0.0.1/dummy</url>
</scm>
I did this expecting that it would store a build number somewhere, and that it would increase it with every build. But what it does is to use the git commit handle as the build number.
Is it possible to get the build number plugin to work like I want? Or is there a different plugin which does what I want? Or should I just accept the working of the build number plugin because using the git commit handle as build number is in my best interest?