The git-changelog-maven-plugin is Maven plugin for generating change log from GIT repository using Mustache templates.
This plugin is currently designed to work with mainline repositories with one main (master) branch.
The git-changelog-maven-plugin is available in Maven Central Repository, to use it from Maven add to pom.xml
:
<plugin>
<groupId>info.plichta.maven.plugins</groupId>
<artifactId>git-changelog-maven-plugin</artifactId>
<version>0.6.0</version>
</plugin>
See releases page for information about versions and notable changes.
Following configuration parameters are supported by the git-changelog-maven-plugin.
repoRoot, default: ${project.basedir}
outputFile, default: ${project.basedir}/CHANGELOG.md
reportTitle, default: Change Log
templateFile, default: ${project.basedir}/changelog.mustache
changelog.mustache
resource from plugin will be used.includeCommits, default: .*
excludeCommits, default: ^\\[maven-release-plugin\\].*
nextRelease, default: ${project.version}
deduplicateChildCommits, default: true
toRef, default: HEAD
jiraServer, optional
gitHubUrl, optional
scmUrl, optional
ignoreOlderThen, optional
You can configure Maven release plugin to update change log with each release.
<plugin>
<artifactId>maven-release-plugin</artifactId>
<configuration>
<preparationGoals>clean git-changelog:git-changelog scm:checkin -DpushChanges=false -Dincludes=CHANGELOG.md -Dmessage="[maven-release-plugin] Update CHANGELOG.md" verify</preparationGoals>
<completionGoals>git-changelog:git-changelog scm:checkin -DpushChanges=false -Dincludes=CHANGELOG.md -Dmessage="[maven-release-plugin] Update CHANGELOG.md"</completionGoals>
</configuration>
</plugin>
In the case you don't like two commits for each release you can use simplified configuration which generates changelog only for release prepare goal:
<plugin>
<artifactId>maven-release-plugin</artifactId>
<configuration>
<preparationGoals>clean git-changelog:git-changelog scm:checkin -DpushChanges=false -Dincludes=CHANGELOG.md -Dmessage="[maven-release-plugin] Update CHANGELOG.md" verify</preparationGoals>
</configuration>
</plugin>
The git-changelog-maven-plugin contains default template for change log generation but you can define any customized template you want.
The git-changelog-maven-plugin provides following data structures to Mustache templates:
- reportTitle
* tags
- name
* commits
- title
- shortHash
- commitLink
* children
- title
- shortHash
- commitLink
- commitTime
- extensions
- jira
* title
- token
- link
- id
- link
- pullRequest
- id
- title
- link
The git-changelog-maven-plugin is free and open-source software provided under The Apache License, Version 2.0.