I am planning to configure semantic versioning for maven project and for CI. Is maven release plugin following conventional commit format? So it will increase the major.minor.patch as per commit message and update changelog.md. Something similar to semantic-release concept in npm. I wonder if there is anything similar in Maven?
Asked
Active
Viewed 1,389 times
2 Answers
1
This your solution: smartling cc4j conventional commits
Usage
This plugin works together with the [Maven Release Plugin] to create conventional commit compliant releases for your Maven projects
Install the PluginIn your main pom.xml
file add the plugin:
<plugins>
<plugin>
<groupId>com.smartling.cc4j</groupId>
<artifactId>conventional-commits-maven-plugin</artifactId>
<version>${version}</version>
</plugin>
</plugins>
Release a Version
mvn conventional-commits:version release:prepare
mvn release:perform

Enver
- 43
- 1
- 8
0
With the maven-release-plugin version 3.0.0 it is now possible to do conventional commits as a part of the release process.
This is done by adding a new VersionPolicy that does this calculation.
I wrote this one https://github.com/nielsbasjes/conventional-commits-maven-release
In its simplest form you can now do something like this:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.0.0</version>
<dependencies>
<dependency>
<groupId>nl.basjes.maven.release</groupId>
<artifactId>conventional-commits-version-policy</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
<configuration>
<projectVersionPolicyId>ConventionalCommitsVersionPolicy</projectVersionPolicyId>
</configuration>
</plugin>

Niels Basjes
- 10,424
- 9
- 50
- 66