elharo opened a new issue, #1649: URL: https://github.com/apache/maven-dependency-plugin/issues/1649
`TreeMojo` has a `scope` parameter (line 122) that is supposed to filter the dependency tree, but it has been non-functional for years due to `MSHARED-4` in the `maven-dependency-tree` library. The TODO at line 232 documents this: ```java // TODO: note that filter does not get applied due to MSHARED-4 ArtifactFilter artifactFilter = createResolvingArtifactFilter(); ``` The `artifactFilter` is passed to `dependencyCollectorBuilder.collectDependencyGraph()` and `dependencyGraphBuilder.buildDependencyGraph()` at lines 241 and 246, but these methods ignore the filter. This means: ```bash mvn dependency:tree -Dscope=compile ``` still shows all scopes (test, provided, etc.) with no warning that the filter was not applied. The fix would be to apply the filter client-side after obtaining the tree, or to fix MSHARED-4 in maven-dependency-tree, or at minimum to log a warning when a scope is specified that it may not be honored. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
