Skip to content

Fix release process: derive version from POM, update all modules, bump next snapshot - #236

Merged
AndreasIgel merged 2 commits into
mainfrom
feature/improving-release-process
Aug 8, 2026
Merged

Fix release process: derive version from POM, update all modules, bump next snapshot#236
AndreasIgel merged 2 commits into
mainfrom
feature/improving-release-process

Conversation

@AndreasIgel

Copy link
Copy Markdown
Collaborator

Problem

The Maven Central release workflow had three issues that could cause incorrect releases or a broken reactor build:

  1. Release version came from a manual input with no validation against the POM. The workflow_dispatch accepted a free-form release_version string. A typo (e.g. entering 0.4.0 when the POM is at 0.5.0-SNAPSHOT) would silently release the wrong version — the only validation was semver format, not consistency with the current codebase state.

  2. example and example-custom-generator POMs were not version-updated. The workflow only ran versions:set on the root, core, and processor POMs, but the subsequent mvn -B clean verify -Prelease (no -pl) builds all four modules. The version mismatch between the example modules (still on 0.5.0-SNAPSHOT) and core/processor (set to 0.5.0) could cause build failures or incorrect dependency resolution.

  3. No next-snapshot bump after release. The PR opened by the workflow contained only the release version commit. When merged, main would sit on a release version (e.g. 0.5.0) instead of a -SNAPSHOT, which is wrong for continued development.

Changes

.github/workflows/maven-central-release.yml

  • Removed the release_version input parameter. The workflow now reads the current POM version via mvn help:evaluate, verifies it's a -SNAPSHOT, strips the suffix, and uses that as the release version. This eliminates the risk of human error.
  • "Update POM versions" step now updates all four modules (core, processor, example, example-custom-generator) instead of only two. Only core and processor are still deployed to Maven Central.
  • Added a new "Prepare next snapshot version" step that computes the next minor version (e.g. 0.5.00.6.0-SNAPSHOT), sets all POMs, and commits it as a second commit on the release branch. The git tag points to the first commit (release version), so it is unaffected. Both commits reach main via the same pull request.
  • Updated PR title/body to mention both the release and the next-snapshot bump.
  • Push step uses --force-with-lease to handle the second commit cleanly.

example/pom.xml

  • groupId changed from io.github.java-helpersorg.javahelpers.simple.builders
  • Dependency reference to example-custom-generator updated to new groupId

example-custom-generator/pom.xml

  • groupId changed from org.javahelpers.simple.builders.exampleorg.javahelpers.simple.builders

example-custom-generator/README.md

  • XML snippet groupId updated to match

RELEASE.md

  • Updated to reflect POM-derived versioning, all-module updates, next-snapshot bump, PR-based merge flow, and accurate module deployment info

Verification

  • Full reactor build (mvn clean install) passes — all 5 modules, all tests green (26 example tests + full processor test suite)
  • mvn help:evaluate -Dexpression=project.version -q -DforceStdout correctly returns 0.5.0-SNAPSHOT (confirms the version-reading approach the workflow uses)
  • Next-version computation verified: 0.5.00.6.0-SNAPSHOT, 0.6.00.7.0-SNAPSHOT
  • No stale groupId references remain in POMs or docs (Java package names intentionally unchanged)

Notes

  • The example and example-custom-generator modules are version-updated alongside the released modules but are not deployed to Maven Central (deploy step still uses -pl core,processor).
  • The main branch must always be on a -SNAPSHOT version after this change. The workflow will fail with a clear error message if it isn't.
  • Java package names (org.javahelpers.simple.builders.example) are unchanged — only Maven groupIds were unified.

…p next snapshot

The release workflow had three issues that could cause incorrect releases
or a broken reactor build:

1. The release version came from a manual workflow_dispatch input with no
   cross-check against the current POM version. A typo (e.g. entering 0.4.0
   when the POM is at 0.5.0-SNAPSHOT) would release the wrong version. The
   input is now removed entirely; the workflow reads the POM version, verifies
   it is a -SNAPSHOT, and strips the suffix to derive the release version.

2. Only core and processor POMs were version-updated, but the reactor build
   (mvn verify with no -pl) includes example and example-custom-generator.
   The version mismatch could cause build failures or incorrect dependency
   resolution. All four modules are now updated together; only core and
   processor are still deployed to Maven Central.

3. After a release, main was left on the release version (e.g. 0.5.0) with
   no next-snapshot bump. A new "Prepare next snapshot version" step now
   computes the next minor snapshot (0.5.0 -> 0.6.0-SNAPSHOT), sets all POMs,
   and commits it as a second commit on the release branch. The git tag
   points to the first commit (release version), so it is unaffected. Both
   commits reach main via the same pull request.

Additionally, the groupId of the example modules is unified to
org.javahelpers.simple.builders (was io.github.java-helpers for example
and org.javahelpers.simple.builders.example for example-custom-generator).
Java package names are unchanged. RELEASE.md is updated to match the actual
workflow behavior.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Dependency Review

The following issues were found:

  • ✅ 0 vulnerable package(s)
  • ❌ 3 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 4 package(s) with unknown licenses.

View full job summary

@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@sonarqubecloud

sonarqubecloud Bot commented Aug 8, 2026

Copy link
Copy Markdown

@AndreasIgel
AndreasIgel merged commit 8cb0055 into main Aug 8, 2026
8 checks passed
@AndreasIgel
AndreasIgel deleted the feature/improving-release-process branch August 8, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant