Skip to content

Use settings.xml repositories for parent POM resolution - #95

Merged
eed3si9n merged 1 commit into
sbt:mainfrom
labianchin:fixPom1
May 1, 2026
Merged

Use settings.xml repositories for parent POM resolution#95
eed3si9n merged 1 commit into
sbt:mainfrom
labianchin:fixPom1

Conversation

@labianchin

@labianchin labianchin commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

The repositories parameter in loadEffectivePom was accepted but ignored. MavenModelResolver was constructed once at class level with only Maven Central, so parent POMs hosted on custom repos (Nexus, Artifactory, etc.) could not be resolved.

Wire repositories from Maven settings.xml active profiles into MavenModelResolver by extracting them as RemoteRepository objects and passing them through the loadEffectivePom call chain. Also construct MavenModelResolver per-call instead of sharing a single mutable instance, preventing repository state from leaking across calls.

The repositories parameter in loadEffectivePom was accepted but
ignored. MavenModelResolver was constructed once at class level
with only Maven Central, so parent POMs hosted on custom repos
(Nexus, Artifactory, etc.) could not be resolved.

Wire repositories from Maven settings.xml active profiles into
MavenModelResolver by extracting them as Aether RemoteRepository
objects and passing them through the loadEffectivePom call chain.
Also construct MavenModelResolver per-call instead of sharing a
single mutable instance, preventing repository state from leaking
across calls.

Fixes sbt#72
@labianchin

Copy link
Copy Markdown
Contributor Author

PTAL @gemelen @xuwei-k @eed3si9n

@gemelen

gemelen commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

@labianchin thank you for your contribution.

@labianchin

Copy link
Copy Markdown
Contributor Author

Ping @gemelen @xuwei-k @eed3si9n , any change we could eventually ship and release this?

@eed3si9n eed3si9n left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@eed3si9n
eed3si9n merged commit 23d2357 into sbt:main May 1, 2026
2 checks passed
@eed3si9n

eed3si9n commented May 1, 2026

Copy link
Copy Markdown
Member

I don't actively maintain this plugin, but I'd be happy to land this and get it out.

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.

Allow adding custom remote repositories to MavenPomResolver

3 participants