Skip to content

[3.9.x] Apply session authentication to descriptor repositories by provenance - #13007

Closed
slachiewicz wants to merge 2 commits into
apache:maven-3.9.xfrom
slachiewicz:repo-provenance-auth-3.9.x
Closed

[3.9.x] Apply session authentication to descriptor repositories by provenance#13007
slachiewicz wants to merge 2 commits into
apache:maven-3.9.xfrom
slachiewicz:repo-provenance-auth-3.9.x

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

DefaultModelResolver in maven-resolver-provider builds the models of artifact descriptors resolved from repositories (dependency POMs and their parents and imports). The repositories those models declare are remotely supplied input, but they were aggregated with the same call as build-supplied repositories, so a <server> in settings.xml whose id matched a repository id in a downloaded POM had its credentials attached to that repository.

maven-resolver 1.9.28 (apache/maven-resolver#2092) adds an aggregateRepositories overload with a provenance flag: descriptor-declared repositories receive session authentication only when an operator-defined mirror captures them, and aether.remoteRepositoryManager.authToDescriptorRepositories=true restores the previous behaviour. This passes that flag from the one call site that builds descriptor models. ProjectModelResolver builds the project's own model and parents, which are operator-chosen, and keeps the four-argument call.

Blocked on the maven-resolver 1.9.28 release: the second commit bumps resolverVersion to 1.9.28-SNAPSHOT as a build aid and must be dropped, and the first commit does not compile against 1.9.27.

Verified: mvn -pl maven-resolver-provider,maven-core -am verify against 1.9.28-SNAPSHOT → 363 tests, 0 failures.

This change was created with AI assistance.

DefaultModelResolver builds the models of artifact descriptors resolved
from repositories, so the repositories those models declare are remotely
supplied input. Pass them to the resolver's aggregateRepositories
overload (maven-resolver 1.9.28, apache/maven-resolver#2092) flagged as
descriptor-declared, so session authentication matched by repository id
is applied to them only when an operator-defined mirror captures them.
Repositories supplied by the build itself are unaffected.
@slachiewicz slachiewicz added bug Something isn't working mvn3 labels Sep 2, 2026
@slachiewicz slachiewicz closed this Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working mvn3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant