Repository navigation
Resolve parent and imported POMs from repositories declared in the POM chain - #562
Merged
slachiewicz merged 1 commit intoNov 8, 2026
Conversation
…M chain FlattenModelResolver ignored the repositories that a parent POM or an imported BOM declares, so flatten could not rebuild a model that Maven core had built, such as a BOM whose parent is only in a repository the BOM declares. Add them to the requests the way Maven's model resolvers do, with the settings' mirrors applied, and give each copy of the resolver its own list. Fixes mojohaus#561
Member
|
Thank you @dodoshell for this fix! Resolving parent and imported POMs from repositories declared in the POM chain addresses #561 cleanly with proper policy conversion and mirror/proxy support. I have added the bug label to trigger CI verification. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FlattenModelResolver.addRepositorywas a no-op, so a parent POM or an imported BOM was only looked up in the project's remote repositories, never in a repository declared by a POM further down the chain. Maven core builds such a model fine, and flatten then fails to rebuild it.addRepositoryadds the repository after the project's ones, or replaces it by id whenreplaceis set, as Maven'sProjectModelResolverdoes. The settings' mirrors, proxies and authentication are applied throughRepositorySystem.newResolutionRepositories, so no new dependency is needed; a repository whose mirror is already in the list is not added again.newCopy()copies the list, so repositories from one imported BOM don't leak into the resolution of another.CreateEffectivePomTestpasses the container'sRepositorySysteminstead ofnull, since the model builder now reaches it for the super POM'scentral.Verified: the new
FlattenModelResolverTestfails without the change (4 tests), andmvn -P run-its verifypasses.Fixes #561