{"id":20428301,"url":"https://github.com/tomasbjerre/git-changelog-maven-plugin","last_synced_at":"2025-04-05T10:07:06.955Z","repository":{"id":2455026,"uuid":"46218315","full_name":"tomasbjerre/git-changelog-maven-plugin","owner":"tomasbjerre","description":"Maven plugin that can generate a changelog, or releasenotes, from git repository","archived":false,"fork":false,"pushed_at":"2025-03-16T15:04:53.000Z","size":709,"stargazers_count":86,"open_issues_count":12,"forks_count":36,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-29T09:07:58.765Z","etag":null,"topics":["changelog","git","github","jira"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomasbjerre.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["tomasbjerre"]}},"created_at":"2015-11-15T13:18:29.000Z","updated_at":"2025-03-16T15:04:56.000Z","dependencies_parsed_at":"2023-12-01T18:38:24.384Z","dependency_job_id":"8c972501-99cf-4257-9cae-52cf2d8ad804","html_url":"https://github.com/tomasbjerre/git-changelog-maven-plugin","commit_stats":null,"previous_names":[],"tags_count":133,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasbjerre%2Fgit-changelog-maven-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasbjerre%2Fgit-changelog-maven-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasbjerre%2Fgit-changelog-maven-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasbjerre%2Fgit-changelog-maven-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomasbjerre","download_url":"https://codeload.github.com/tomasbjerre/git-changelog-maven-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247318744,"owners_count":20919484,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["changelog","git","github","jira"],"created_at":"2024-11-15T07:25:05.985Z","updated_at":"2025-04-05T10:07:06.931Z","avatar_url":"https://github.com/tomasbjerre.png","language":"Java","funding_links":["https://github.com/sponsors/tomasbjerre"],"categories":[],"sub_categories":[],"readme":"# Git Changelog Maven Plugin\n\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/se.bjurr.gitchangelog/git-changelog-maven-plugin/badge.svg)](https://maven-badges.herokuapp.com/maven-central/se.bjurr.gitchangelog/git-changelog-maven-plugin)\n\nThis is a Maven plugin for [Git Changelog Lib](https://github.com/tomasbjerre/git-changelog-lib).\n\n| Version                  | Java Version |\n| ------------------------ | ------------ |\n| version \u003c 2.0.0          | 8            |\n| 2.0.0 \u003c= version \u003c 2.2.0 | 11           |\n| 2.2.0 \u003c= version         | 17           |\n\n## Usage\n\nThere is a running example [here](/git-changelog-maven-plugin-example). See also [bjurr-bom](https://github.com/tomasbjerre/bjurr-bom).\n\nHave a look at the [pom.xml](/git-changelog-maven-plugin-example/pom.xml) where you will find some more examples.\n\nHere is and example that will generate a CHANGELOG.md when running `mvn generate-resources`.\n\n```xml\n  \u003cbuild\u003e\n    \u003cplugins\u003e\n     \u003cplugin\u003e\n      \u003cgroupId\u003ese.bjurr.gitchangelog\u003c/groupId\u003e\n      \u003cartifactId\u003egit-changelog-maven-plugin\u003c/artifactId\u003e\n      \u003cversion\u003e${changelog}\u003c/version\u003e\n      \u003cdependencies\u003e\n       \u003c!-- This dependency is only needed if you add your own javascript-helpers //--\u003e\n       \u003cdependency\u003e\n        \u003cgroupId\u003eorg.openjdk.nashorn\u003c/groupId\u003e\n        \u003cartifactId\u003enashorn-core\u003c/artifactId\u003e\n        \u003cversion\u003e15.4\u003c/version\u003e\n       \u003c/dependency\u003e\n      \u003c/dependencies\u003e\n      \u003cexecutions\u003e\n       \u003cexecution\u003e\n        \u003cid\u003eGenerateGitChangelog\u003c/id\u003e\n        \u003cphase\u003egenerate-sources\u003c/phase\u003e\n        \u003cgoals\u003e\n         \u003cgoal\u003egit-changelog\u003c/goal\u003e\n        \u003c/goals\u003e\n        \u003cconfiguration\u003e\n         \u003ctemplateContent\u003e\n         \u003c![CDATA[\n          Optional template here!\n          Context documented here: https://github.com/tomasbjerre/git-changelog-lib\n         ]]\u003e\n         \u003c/templateContent\u003e\n        \u003c/configuration\u003e\n       \u003c/execution\u003e\n      \u003c/executions\u003e\n     \u003c/plugin\u003e\n    \u003c/plugins\u003e\n  \u003c/build\u003e\n```\n\nIf you have a multimodule you may want to put `\u003cinherited\u003efalse\u003c/inherited\u003e` within the `\u003cplugin\u003e` tag to avoid it being applied to all child projects.\n\n### Template - Simple\n\n```hbs\n{{#tags}}\n## {{name}}\n {{#issues}}\n  {{#hasIssue}}\n   {{#hasLink}}\n### {{name}} [{{issue}}]({{link}}) {{title}} {{#hasIssueType}} *{{issueType}}* {{/hasIssueType}} {{#hasLabels}} {{#labels}} *{{.}}* {{/labels}} {{/hasLabels}}\n   {{/hasLink}}\n   {{^hasLink}}\n### {{name}} {{issue}} {{title}} {{#hasIssueType}} *{{issueType}}* {{/hasIssueType}} {{#hasLabels}} {{#labels}} *{{.}}* {{/labels}} {{/hasLabels}}\n   {{/hasLink}}\n  {{/hasIssue}}\n  {{^hasIssue}}\n### {{name}}\n  {{/hasIssue}}\n\n  {{#commits}}\n**{{{messageTitle}}}**\n\n{{#messageBodyItems}}\n * {{.}}\n{{/messageBodyItems}}\n\n[{{hash}}](https://github.com/{{ownerName}}/{{repoName}}/commit/{{hash}}) {{authorName}} *{{commitTime}}*\n\n  {{/commits}}\n\n {{/issues}}\n{{/tags}}\n```\n\n### Template - Semantic versioning from conventional commits\n\nIf you are using [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/):\n\n```shell\n\u003ctype\u003e[optional scope]: \u003cdescription\u003e\n\n[optional body]\n\n[optional footer(s)]\n```\n\nA changelog can be rendered (using [Helpers](https://github.com/tomasbjerre/git-changelog-lib#Helpers)) like this:\n\n```hbs\n# Changelog\n\n{{#tags}}\n{{#ifReleaseTag .}}\n## [{{name}}](https://gitservice/{{name}}) ({{tagDate .}})\n\n  {{#ifContainsType commits type='feat'}}\n### Features\n\n    {{#commits}}\n      {{#ifCommitType . type='feat'}}\n - {{#eachCommitScope .}} **{{.}}** {{/eachCommitScope}} {{{commitDescription .}}} ([{{hash}}](https://gitservice/commit/{{hashFull}}))\n      {{/ifCommitType}}\n    {{/commits}}\n  {{/ifContainsType}}\n\n  {{#ifContainsType commits type='fix'}}\n### Bug Fixes\n\n    {{#commits}}\n      {{#ifCommitType . type='fix'}}\n - {{#eachCommitScope .}} **{{.}}** {{/eachCommitScope}} {{{commitDescription .}}} ([{{hash}}](https://gitservice/commit/{{hashFull}}))\n      {{/ifCommitType}}\n    {{/commits}}\n  {{/ifContainsType}}\n\n{{/ifReleaseTag}}\n{{/tags}}\n```\n\n### Example - custom helpers\n\nYou can add your own helpers and use them in the template. There are also [built in Helpers](https://github.com/tomasbjerre/git-changelog-lib#Helpers).\n\n```xml\n  \u003cbuild\u003e\n    \u003cplugins\u003e\n     \u003cplugin\u003e\n      \u003cgroupId\u003ese.bjurr.gitchangelog\u003c/groupId\u003e\n      \u003cartifactId\u003egit-changelog-maven-plugin\u003c/artifactId\u003e\n      \u003cversion\u003e${changelog}\u003c/version\u003e\n      \u003cdependencies\u003e\n       \u003c!-- This dependency is only needed if you add your own javascript-helpers //--\u003e\n       \u003cdependency\u003e\n        \u003cgroupId\u003eorg.openjdk.nashorn\u003c/groupId\u003e\n        \u003cartifactId\u003enashorn-core\u003c/artifactId\u003e\n        \u003cversion\u003e15.4\u003c/version\u003e\n       \u003c/dependency\u003e\n      \u003c/dependencies\u003e\n      \u003cexecutions\u003e\n       \u003cexecution\u003e\n        \u003cid\u003eGenerateGitChangelog\u003c/id\u003e\n        \u003cphase\u003egenerate-sources\u003c/phase\u003e\n        \u003cgoals\u003e\n         \u003cgoal\u003egit-changelog\u003c/goal\u003e\n        \u003c/goals\u003e\n        \u003cconfiguration\u003e\n          \u003cjavascriptHelper\u003e\n\u003c![CDATA[\nHandlebars.registerHelper('startsWith', function(messageTitle, options) {\n  const s = options.hash['s']\n  if (new RegExp('^' + s + '.*').test(messageTitle)) {\n    return options.fn(this);\n  } else {\n    return options.inverse(this);\n  }\n});\n\nHandlebars.registerHelper('firstLetters', function(from, options) {\n  const num = parseInt(options.hash['number'])\n  return from.substring(0,num)\n});\n]]\u003e\n          \u003c/javascriptHelper\u003e\n          \u003ctemplateContent\u003e\n\u003c![CDATA[\n{{#commits}}\n  {{#startsWith messageTitle s='Removing'}}\n    Starts with Removing: \"{{messageTitle}}\"\n    first 10 letters of hash is: {{firstLetters hash number='10'}}\n  {{/startsWith}}\n{{/commits}}\n]]\u003e\n          \u003c/templateContent\u003e\n        \u003c/configuration\u003e\n       \u003c/execution\u003e\n      \u003c/executions\u003e\n     \u003c/plugin\u003e\n    \u003c/plugins\u003e\n  \u003c/build\u003e\n```\n\nMore documentation can be found in the [Git Changelog Lib](https://github.com/tomasbjerre/git-changelog-lib).\n\n### Configuration\n\nHave a look at the [pom.xml](/git-changelog-maven-plugin-example/pom.xml) where you will find some more examples.\n\n#### Update version based on conventional commits\n\nThe version in `pom.xml` can be automatically updated based on [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/).\n\nFrom command line:\n\n```sh\nmvn se.bjurr.gitchangelog:git-changelog-maven-plugin:VERSION_HERE:semantic-version\n```\n\nYou can combine it with maven release plugin like this:\n\n```sh\nmvn \\\n  se.bjurr.gitchangelog:git-changelog-maven-plugin:VERSION_HERE:semantic-version \\\n  release:prepare release:perform\n```\n\nOr in `pom.xml`:\n\n```xml\n  \u003cbuild\u003e\n    \u003cplugins\u003e\n     \u003cplugin\u003e\n      \u003cgroupId\u003ese.bjurr.gitchangelog\u003c/groupId\u003e\n      \u003cartifactId\u003egit-changelog-maven-plugin\u003c/artifactId\u003e\n      \u003cversion\u003e${changelog}\u003c/version\u003e\n      \u003cdependencies\u003e\n       \u003c!-- This dependency is only needed if you add your own javascript-helpers //--\u003e\n       \u003cdependency\u003e\n        \u003cgroupId\u003eorg.openjdk.nashorn\u003c/groupId\u003e\n        \u003cartifactId\u003enashorn-core\u003c/artifactId\u003e\n        \u003cversion\u003e15.4\u003c/version\u003e\n       \u003c/dependency\u003e\n      \u003c/dependencies\u003e\n      \u003cexecutions\u003e\n       \u003cexecution\u003e\n        \u003cid\u003eGenerateGitChangelog\u003c/id\u003e\n        \u003cphase\u003egenerate-sources\u003c/phase\u003e\n        \u003cgoals\u003e\n         \u003cgoal\u003esemantic-version\u003c/goal\u003e\n        \u003c/goals\u003e\n        \u003cconfiguration\u003e\n          \u003c!-- Suffix version with -SNAPSHOT //--\u003e\n          \u003cupdatePomWithNextSemanticVersionSuffixSnapshot\u003efalse\u003c/updatePomWithNextSemanticVersionSuffixSnapshot\u003e\n          \u003cupdatePomWithCurrentSemanticVersionSuffixSnapshotIfNotTagged\u003etrue\u003c/updatePomWithCurrentSemanticVersionSuffixSnapshotIfNotTagged\u003e\n\n          \u003c!-- Regexp patterns used to identify next version can optionally be adjusted //--\u003e\n          \u003csemanticMajorVersionPattern\u003e^[Bb]reaking\u003c/semanticMajorVersionPattern\u003e\n          \u003csemanticMinorVersionPattern\u003e[Ff]eature\u003c/semanticMinorVersionPattern\u003e\n          \u003csemanticPatchVersionPattern\u003e[Ff]ix\u003c/semanticPatchVersionPattern\u003e\n        \u003c/configuration\u003e\n       \u003c/execution\u003e\n      \u003c/executions\u003e\n     \u003c/plugin\u003e\n    \u003c/plugins\u003e\n  \u003c/build\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomasbjerre%2Fgit-changelog-maven-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomasbjerre%2Fgit-changelog-maven-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomasbjerre%2Fgit-changelog-maven-plugin/lists"}