Resolve with effective Maven settings in recipes - #8190
Draft
pdelagrave wants to merge 1 commit into
Draft
Conversation
Several recipes passed the raw LST-carried settings (or none at all) to `MavenPomDownloader` or `MavenExecutionContextView#getRepositories`, so mirrors and repositories supplied on the execution context at run time were ignored during parent pom, metadata, and repository-order resolution. Introduce `MavenPomDownloader#forResolutionResult`, which combines the LST-carried settings with those on the execution context, and use the effective settings at every such call site.
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.
What's changed?
Recipes that construct their own
MavenPomDownloader(UpdateMavenModel,ChangeParentPom,RemoveRedundantDependencyVersions,RemoveUnusedProperties,RemoveRedundantProperties,ParentPomInsight,MavenDependencyPropertyUsageOverlap, andMavenDependency's exact-version fallback) passed the raw LST-carried settings, or none at all, to the downloader. A newMavenPomDownloader#forResolutionResultfactory combines the LST-carried settings with those on the execution context, and every such call site now uses it (oreffectiveSettingsdirectly where a caller-supplied project poms map is load-bearing).FindRepositoryOrdergets the same treatment on thegetRepositoriespath.A recipe-level test is added to
MavenCentralMirrorTest: an LST produced without any mirror, resolved by a recipe under an execution context that carries one, must route all parent pom traffic through the context's mirror. The test fails if any converted call site regresses to passing raw LST settings.What's your motivation?
Mirrors and repositories supplied on the execution context at run time were silently ignored during parent pom, metadata, and repository-order resolution in these recipes: the settings argument of
MavenPomDownloaderreplaces, rather than combines with, the settings on the execution context.MavenVisitorandUpgradeDependencyVersionalready resolved with the effective settings; this aligns the remaining call sites and gives the pattern a single named entry point so the next recipe gets it right by default.Any additional context
effectiveSettingsmeaningful; the base branch is set accordingly and this PR should be retargeted or rebased once Fix MavenSettings value equality dropping LST-carried mirrors #8189 merges.Checklist