Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set "VERSION_WITH_BRANCH" versionCreator as default #772

Merged
merged 3 commits into from
Jul 5, 2024

Conversation

bgalek
Copy link
Member

@bgalek bgalek commented Jul 5, 2024

There is a common problem with collaboration on code using this plugin.

When multiple feature branches are being developed (diverged from the same HEAD), by default, they will use a SIMPLE version creator that does not decorate versions in any way. So, both feature branches will generate the same version (v0.0.1-SNAPSHOT), leading to overriding snapshots during publication. That is prone to errors since Maven allows overriding SNAPSHOT versions.

This PR changes the default versionCreator to VERSION_WITH_BRANCH, which will append the branch name to version (v0.0.1-my-branch-name-SNAPSHOT) and will fallback to SIMPLE for detached HEAD checkouts (old behavior)

People who explicitly need the SIMPLE version will need to update their configurations.

Draft release

Screenshot 2024-07-05 at 10 11 03

@bgalek bgalek marked this pull request as ready for review July 5, 2024 08:05
Comment on lines 268 to 272
During this phase version will be decorated with branch name.
`axion-release-plugin` supports adding predefined named version creators
(so don't be afraid to post pull request if you have something useful!).
Decoration phase is conducted by *version creators*,
you can configure it via `scmVersion.versionCreator`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would state more explicitly that default version creator is versionWithBranch

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check it now :)

@bgalek bgalek merged commit c4b95c7 into main Jul 5, 2024
3 checks passed
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.

3 participants