Skip to content

[MRELEASE-799] Preserve explicit previous-version property references - #1500

Open
goutamadwant wants to merge 1 commit into
apache:masterfrom
goutamadwant:fix-mrelease-799-previous-version
Open

goutamadwant wants to merge 1 commit into
apache:masterfrom
goutamadwant:fix-mrelease-799-previous-version

Conversation

@goutamadwant

Copy link
Copy Markdown

Fixes #1004 (MRELEASE-799).

release:update-versions fails when a plugin dependency references a reactor artifact's previous release through a property, while the equivalent literal version is preserved. For example, a project at 2.0-SNAPSHOT using its own 1.0 release through ${previous.version} cannot advance to 2.1-SNAPSHOT.

Preserve locally defined literal property values that refer to a different original artifact version. Cache original values as version references are visited, including CI-friendly properties before project-version rewriting. After rewriting, reject shared properties that would change a preserved reference. This retains conflict detection regardless of reference order and applies through the shared POM rewrite phases.

Validation:

  • Reproduced the failure with the unchanged master plugin; the patched release:update-versions advances the project and retains ${previous.version} at 1.0.
  • Added native POM rewrite regressions across update-versions, release, development, and branch phases, including current-version updates, literal references, shared-property conflicts in both orders, and CI-friendly version conflicts.
  • mvn -Prun-its verify passed with Maven 3.9.16 and Java 21.
  • Final focused regressions passed on Java 8 and Java 21.

This change is limited to locally resolvable literal property values; it does not add resolution of inherited properties or composed expressions.

Checklist:

  • This pull request addresses one issue.
  • The description explains what changed, how, and why.
  • The commit has a meaningful subject and body.
  • Added regression tests that fail without the production fix.
  • Basic verification passed through mvn -Prun-its verify.
  • Integration tests passed with mvn -Prun-its verify.
  • I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004.
  • In any other case, please file an Apache Individual Contributor License Agreement.

Retain locally resolved property references to a different original artifact version across the shared POM rewrite phases. Cache original values before mutation and reject conflicting shared-property changes regardless of reference order. Add native regression coverage including CI-friendly version rewriting. Fixes apache#1004.
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.

[MRELEASE-799] update-versions fails when the project artifact is used with a version other than the current snapshot

1 participant