Skip to content

Collect the filtered dependencies with RepositorySystem directly - #306

Merged
slachiewicz merged 1 commit into
masterfrom
agent/analyzer-collect-directly
Oct 19, 2026
Merged

slachiewicz merged 1 commit into
masterfrom
agent/analyzer-collect-directly

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

To collect the dependency graph of a filtered dependency set, DefaultProjectDependencyAnalyzer copied the project into a private DependencyGraphProject extends MavenProject and ran it through ProjectDependenciesResolver with a filter that resolved no files. It now builds the CollectRequest itself and calls RepositorySystem.collectDependencies, the same request maven-core 3.9's resolver builds: session decorators applied, the project artifact as root, the project context, remote project repositories and managed dependencies. No public API changes.

Part of apache/maven#13309.

Verified: mvn verify -Prun-its before and after → 23 ITs pass both times, and the analysis.txt written by all 29 IT projects is identical.

The request mirrors what maven-core 3.9's DefaultProjectDependenciesResolver builds: session decorators, root artifact, the "project" context, remote project repositories and managed dependencies. Do not go back to subclassing MavenProject to feed ProjectDependenciesResolver; it has no Maven 4 API counterpart.
@slachiewicz
slachiewicz marked this pull request as ready for review October 1, 2026 06:19
@slachiewicz
slachiewicz merged commit 0755b77 into master Oct 19, 2026
21 checks passed
@slachiewicz
slachiewicz deleted the agent/analyzer-collect-directly branch October 19, 2026 18:02
@github-actions github-actions Bot added this to the 1.17.3 milestone Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant