Decouple Maven Releases from Version Logic
In standard Maven projects, versions are hardcoded in the POM, requiring a manual update after every release. This workflow is prone to several issues that often complicate CI/CD pipelines. I will explain why this approach is problematic and show a better way to handle releases by decoupling the version and Git operations from Maven. Let’s first revise what Maven offers out of the box, namely the maven-release-plugin workflow: Change version from 0.1.0-SNAPSHOT to 0.1.0. Commit the change and create a Git release tag. Build and push the tagged version to the repository. Bump the version to 0.1.1-SNAPSHOT and commit again. Issues with Maintaining Hardcoded Versions in POM Noise in Git History Tags are required as they mark a point in Git history where we can reliably track releases. Version change commits, on the other hand, are not used in any context and add noise. ...