feat: per-module CHANGELOG.md support - #181
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for per-module changelog generation in independent-versioned multi-module Maven projects by introducing a new changelog: "module" configuration mode, with BOM-aware rollup behavior preserved via an additional root changelog when applicable.
Changes:
- Introduces
ChangesetsConfig.ChangelogMode.MODULEand validates it againstfixedversioning. - Updates
PrepareMojoto write oneCHANGELOG.mdper bumped module inMODULEmode, plus an optional BOM rollup at the reactor root. - Adds documentation and new integration tests covering module and module+ BOM scenarios.
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents changelog: "module" behavior and configuration reference updates. |
| changesets-maven-plugin/src/main/java/se/fortnox/changesets/maven/PrepareMojo.java | Branches changelog writing to per-module mode; keeps BOM rollup behavior. |
| changesets-maven-plugin/src/it/module-changelog/verify.groovy | IT verification for per-module changelog output (no BOM). |
| changesets-maven-plugin/src/it/module-changelog/pom.xml | New IT project for module changelog scenario. |
| changesets-maven-plugin/src/it/module-changelog/module-a/pom.xml | IT module A setup. |
| changesets-maven-plugin/src/it/module-changelog/module-a/EXPECTED_CHANGELOG.md | Expected per-module changelog for module A. |
| changesets-maven-plugin/src/it/module-changelog/module-b/pom.xml | IT module B setup. |
| changesets-maven-plugin/src/it/module-changelog/module-b/EXPECTED_CHANGELOG.md | Expected per-module changelog for module B. |
| changesets-maven-plugin/src/it/module-changelog/invoker.properties | Maven Invoker configuration for the new IT. |
| changesets-maven-plugin/src/it/module-changelog/.changeset/config.json | IT config enabling independent + module changelog mode. |
| changesets-maven-plugin/src/it/module-changelog/.changeset/bump-a.md | IT changeset for module A bump. |
| changesets-maven-plugin/src/it/module-changelog/.changeset/bump-b.md | IT changeset for module B bump. |
| changesets-maven-plugin/src/it/module-changelog-bom/verify.groovy | IT verification for per-module changelog output with BOM rollup. |
| changesets-maven-plugin/src/it/module-changelog-bom/pom.xml | New IT project for module changelog + BOM scenario. |
| changesets-maven-plugin/src/it/module-changelog-bom/invoker.properties | Maven Invoker configuration for the BOM IT. |
| changesets-maven-plugin/src/it/module-changelog-bom/EXPECTED_CHANGELOG.md | Expected root rollup changelog for BOM scenario. |
| changesets-maven-plugin/src/it/module-changelog-bom/consumer-parent/pom.xml | IT consumer-parent module for BOM header behavior. |
| changesets-maven-plugin/src/it/module-changelog-bom/bom/pom.xml | IT BOM module with pinned properties for starters. |
| changesets-maven-plugin/src/it/module-changelog-bom/starter-a/pom.xml | IT starter A setup. |
| changesets-maven-plugin/src/it/module-changelog-bom/starter-a/EXPECTED_CHANGELOG.md | Expected per-module changelog for starter A. |
| changesets-maven-plugin/src/it/module-changelog-bom/starter-b/pom.xml | IT starter B setup. |
| changesets-maven-plugin/src/it/module-changelog-bom/starter-b/EXPECTED_CHANGELOG.md | Expected per-module changelog for starter B. |
| changesets-maven-plugin/src/it/module-changelog-bom/.changeset/config.json | IT config enabling BOM + per-module changelog mode. |
| changesets-maven-plugin/src/it/module-changelog-bom/.changeset/bump-a.md | IT changeset for starter A bump. |
| changesets-maven-plugin/src/it/module-changelog-bom/.changeset/bump-b.md | IT changeset for starter B bump. |
| changesets-java/src/test/java/se/fortnox/changesets/ChangesetsConfigTest.java | Unit tests for parsing/validating module changelog mode. |
| changesets-java/src/main/java/se/fortnox/changesets/ChangesetsConfig.java | Adds ChangelogMode.MODULE and validation against FIXED. |
| .changeset/swift-modules-changelog.md | Changeset documenting the feature addition. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| - No reactor-root `CHANGELOG.md` is written. Any existing root `CHANGELOG.md` is left untouched. | ||
| - If a [BOM](#bom-bill-of-materials-support) is also configured, the reactor-root `CHANGELOG.md` is *additionally* written as | ||
| a rollup summary — one entry per bumped module under a single `consumer-parent@<bomVersion>` header, with each module's | ||
| changes nested below — so consumers see a dependabot-style overview of what moved in that BOM release while the | ||
| authoritative per-module history lives next to each module. |
|
@copilot resolve the merge conflicts in this pull request |
Co-authored-by: AnteLund <3100297+AnteLund@users.noreply.github.com>
Resolved the merge conflict in README.md (commit 27807c4). The conflict was in the |
| release-plugin), omit `useReleasePluginIntegration`. The trade-off is an extra "chore: prepare release" commit | ||
| before `release:prepare` runs. No newline at end of file | ||
| before `release:prepare` runs. | ||
|
|
There was a problem hiding this comment.
This header seems to have been mistakenly added.
Summary
Adds a new
changelog: "module"option to.changeset/config.jsonso that, withindependentversioning, each bumped submodule gets its ownCHANGELOG.mdnext to itspom.xmlinstead of one aggregated file at the reactor root.New
ChangelogMode.MODULEenum value onChangesetsConfig, with validation that rejects it when combined withfixedversioning (all modules would share one version anyway).PrepareMojo.writeChangelogbranches on the mode: inMODULEmode it writes one file per bumped module.When a BOM is also configured, the reactor-root
CHANGELOG.mdis additionally written as a dependabot-style rollup — one nested entry per bumped module under a singleconsumer-parent@<bomVersion>header — so consumers still get an at-a-glance overview of what moved in that BOM release while the authoritative per-module history lives next to each module.Behavior is unchanged when
changelogis absent (defaults toroot); existing repos need no config edit.Documentation
Unit- and Integration test