I have a maven project with lots of modules (and modules inside modules). I am using maven-release-plugin for controlling the versions in the pom.xml files.
When running command mvn release:prepare plugin is pushing two commits with messages: "[maven-release-plugin] prepare release v0.9.0.38" and "[maven-release-plugin] prepare for next development iteration" accordingly. Herein the second one is just snapshot version.
Here is the maven-release-plugin settings:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<tagNameFormat>v@{project.version}</tagNameFormat>
<autoVersionSubmodules>true</autoVersionSubmodules>
<checkModificationExcludes>
<checkModificationExclude>pom.xml</checkModificationExclude>
<checkModificationExclude>*/pom.xml</checkModificationExclude>
</checkModificationExcludes>
<branchBase>master</branchBase>
</configuration>
</plugin>
</plugins>
</build>
When pushing I am setting the tag to the remote git project as well (You can see it in <tagNameFormat>v@{project.version}</tagNameFormat>) so I need to push commits definitely, but I don't want it to push snapshot versions (e.g. 0.9.0.38-SNAPSHOT).
Edit:
The problem:
As I am incrementing minor version of the project on each commit by running
mvn release:prepare.
e.g. Commits looks like following:
[maven-release-plugin] prepare for next development iteration
[maven-release-plugin] prepare release v0.9.0.38
(refactor) Code cleaned up
[maven-release-plugin] prepare for next development iteration
[maven-release-plugin] prepare release v0.9.0.37
(feature) Added I18N support
This looks very ugly, and pushing three commits on every change is very bad solution only for just incrementing minor version of the pom file not manually.
What do I need?
- Before every commit increment project version (including all modules)
- And set the tag to the remote git repository.
- And it should be done by one commit with custom message
How can I achieve this?