Skip to content

[backport 4.0.x] Fix #13004: enable deterministic profile activation for BUILD_CONSUMER - #13015

Merged
gnodet merged 2 commits into
maven-4.0.xfrom
backport/13004-to-4.0.x
Sep 2, 2026
Merged

[backport 4.0.x] Fix #13004: enable deterministic profile activation for BUILD_CONSUMER#13015
gnodet merged 2 commits into
maven-4.0.xfrom
backport/13004-to-4.0.x

Conversation

@gnodet

@gnodet gnodet commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Backport of #13006 (merged to master as d96bf89) to the maven-4.0.x branch.

Enable only deterministic profile activations (OS, JDK, activeByDefault) for BUILD_CONSUMER, so that platform-dependent properties (e.g. ${swt.artifactId} from an OS-activated profile) are resolved before the coordinate validator runs, while keeping the consumer POM reproducible across environments.

  • Packaging-activated profiles are excluded — handled separately by inlinePackagingActivatedProfiles()
  • Repositories from activated profiles are stripped to prevent leaking into the published consumer POM
  • Also fixes pre-existing Spotless violations and a compilation error on master

Closes #13004

🤖 Generated with Claude Code

Enable only deterministic profile activations (OS, JDK, activeByDefault)
for BUILD_CONSUMER, so that platform-dependent properties (e.g.
${swt.artifactId} from an OS-activated profile) are resolved before the
coordinate validator runs, while keeping the consumer POM reproducible
across environments.

Packaging-activated profiles are excluded — they are handled separately
by inlinePackagingActivatedProfiles() in the consumer POM builder.
Repositories from activated profiles are stripped to prevent leaking
into the published consumer POM.

Also fixes pre-existing Spotless violations and a compilation error on
master (DefaultVersionResolver, DefaultVersionRangeResolver,
DistributionManagementArtifactRelocationSourceTest).
@gnodet gnodet added this to the 4.0.0-rc-7 milestone Sep 2, 2026
@gnodet gnodet added bug Something isn't working backport mvn4 labels Sep 2, 2026
@gnodet gnodet self-assigned this Sep 2, 2026
- Add constructor with version range "[4.0.0-rc-7,)"
- Convert extractResources() File return to Path via .getAbsoluteFile().toPath()
- Pass String to newVerifier() via basedir.toString()
- Convert getArtifactPath() String return to Path via Path.of()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet
gnodet merged commit a930702 into maven-4.0.x Sep 2, 2026
23 checks passed
@gnodet
gnodet deleted the backport/13004-to-4.0.x branch September 2, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport bug Something isn't working mvn4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant