Skip to content

Minimize the eager resolution of transitive dependencies when upgrading dependency versions.#7423

Merged
sambsnyd merged 2 commits intomainfrom
minimal-transitive-resolution
Apr 20, 2026
Merged

Minimize the eager resolution of transitive dependencies when upgrading dependency versions.#7423
sambsnyd merged 2 commits intomainfrom
minimal-transitive-resolution

Conversation

@sambsnyd
Copy link
Copy Markdown
Member

In environments with very slow artifact repositories any unnecessary request can dramatically slow recipe runs.
I observed that UpgradeDependencyVersion is unintentionally eagerly resolving the poms of transitive dependencies post-upgrade of a direct dependency.
These alterations lead to further deferral of transitive resolution until something actually needs it.

Comment on lines +1017 to +1019
private List<ResolvedDependency> doResolveDependencies(Scope scope, Map<GroupArtifact, VersionRequirement> requirements,
boolean resolveTransitives,
MavenPomDownloader downloader, ExecutionContext ctx) throws MavenDownloadingExceptions {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not all customers are on cli v4 yet. Won't this break for them also?
Questioning if this change is worth introducing a cli v3 release due to widespread impact.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure I understand the concern @Jenson3210, this method is new code? The old code will continue to work?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh, nevermind. I missed the private part here as I was going over it...
Got confused with the newly added public one here and thought recipes were using this one instead of the other one which would throw NoSuchMethod.

@sambsnyd sambsnyd merged commit 7c7e3c5 into main Apr 20, 2026
1 check passed
@sambsnyd sambsnyd deleted the minimal-transitive-resolution branch April 20, 2026 17:38
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants