Skip to content

[4.0.x] Use request properties consistently for CI-friendly version interpolation#12227

Merged
gnodet merged 1 commit into
apache:maven-4.0.xfrom
gnodet:cherry-pick-12184-to-4.0.x
Jun 4, 2026
Merged

[4.0.x] Use request properties consistently for CI-friendly version interpolation#12227
gnodet merged 1 commit into
apache:maven-4.0.xfrom
gnodet:cherry-pick-12184-to-4.0.x

Conversation

@gnodet
Copy link
Copy Markdown
Contributor

@gnodet gnodet commented Jun 4, 2026

Cherry-pick of #12184

…tion (apache#12184)

The model builder inconsistently used session properties for CI-friendly
version replacement and model property merging, while model interpolation
used request properties. When user properties on the ModelBuilderRequest
differ from the Session (e.g. -Drevision=2.0.0 overriding a POM-defined
revision), ${revision} in dependency versions and distributionManagement
was not properly resolved.

Fix three places in DefaultModelBuilder to use request properties:
- getPropertiesWithProfiles(): use request system+user properties
  instead of session.getEffectiveProperties()
- doReadFileModel(): use request.getUserProperties() instead of
  session.getUserProperties() for model property and profile merging

Also fix DefaultConsumerPomBuilder.buildModel() to pass API Session
properties (iSession) instead of RepositorySystemSession properties
to the model builder request, ensuring consumer POM builds have
access to the full set of user properties.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet gnodet merged commit 8c648c7 into apache:maven-4.0.x Jun 4, 2026
1 check passed
@github-actions github-actions Bot added this to the 4.0.0-rc-6 milestone Jun 4, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 4, 2026

@gnodet Please assign appropriate label to PR according to the type of change.

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