Skip to content

Conventional commits plugins for Java build systems. Maven only for now.

Notifications You must be signed in to change notification settings

olpapchenko/conventional-commits-for-java

 
 

Repository files navigation

Conventional Commits for Java

Provides a Java implementation of Conventional Commits for projects built with Java 1.8+ using Git for version control.

Maven Plugin

Usage

This plugin works together with the Maven Release Plugin to create a conventional commit compliant releases for your Maven projects

Install the Plugin

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

You can provide the link to you tracking system as parameter in configuration. In generated change log there will be the link to the ticket.

<trackingSystemUrlFormat>http://example.com/%s</trackingSystemUrlFormat>

%s - will be replaced by ticket id provided at the begging of message in square brackets. For example:

fix: [ticket-id] message

Also, you can provide the pattern for repository URL. In the generated change log there will be a commit hash with URL to the commit in the remote repository.

<repoUrlFormat>http://example.com/%s</repoUrlFormat>

Release a Version

mvn conventional-commits:version release:prepare
mvn release:perform

With generated change logs

 mvn conventional-commits:version conventional-commits:changelog release:prepare
 mvn release:perform

Changelog example

Commit messages:

breaking change: [ticket-23] change public API

ci: add build step

Generated change log (CHANGELOG.MD):

1.0.0 (2020-11-14)

Breaking changes

CI

  • add build step

Note: changelog goal performs a commit that includes updated CHANGELOG.MD this commit will not be rolled back on release:clean - this is because of well-known maven limitation - release plugin does not allow committing additional files on release:prepare stage

Gradle Plugin

A [Gradle] plugin is planned for future release.

About

Conventional commits plugins for Java build systems. Maven only for now.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 99.1%
  • Other 0.9%