A Maven plugin that increments the version number after an execution phase (e.g. compile, install, deploy, etc.).
Add the following code to your pom.xml:
<build>
<plugins>
<plugin>
<groupId>com.mauriciotogneri</groupId>
<artifactId>incrementormavenplugin</artifactId>
<version>1.2.0</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>incrementor</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>jcenter</id>
<url>https://jcenter.bintray.com</url>
</repository>
</repositories>
If you want to run the plugin after another phase than compile
, replace it by any of this values:
validate
test
package
verify
install
deploy