You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "elharo (via GitHub)" <gi...@apache.org> on 2026/07/07 11:17:10 UTC

[I] dependency:tree -Dscope filter is silently non-functional due to MSHARED-4 [maven-dependency-plugin]

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: issues-unsubscribe@maven.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] dependency:tree -Dscope filter is silently non-functional due to MSHARED-4 [maven-dependency-plugin]

Posted by "elharo (via GitHub)" <gi...@apache.org>.
elharo commented on issue #1649:
URL: https://github.com/apache/maven-dependency-plugin/issues/1649#issuecomment-4904901695

   https://issues.apache.org/jira/browse/MSHARED-4 was closed 5 years ago. If this is still an issue, it should be possible to show a sample project that demonstrates it.


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] dependency:tree -Dscope filter is silently non-functional due to MSHARED-4 [maven-dependency-plugin]

Posted by "slachiewicz (via GitHub)" <gi...@apache.org>.
slachiewicz commented on issue #1649:
URL: https://github.com/apache/maven-dependency-plugin/issues/1649#issuecomment-6037920625

   Fixed on master by MDEP-969 (1dfc4b65): the tree is now built with Maven Resolver and the `scope` filter is applied while building it (`DependencyTreeBuilder`), so the MSHARED-4 limitation and its TODO are gone. It ships in the release after 3.11.0.


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] dependency:tree -Dscope filter is silently non-functional due to MSHARED-4 [maven-dependency-plugin]

Posted by "slachiewicz (via GitHub)" <gi...@apache.org>.
slachiewicz closed issue #1649: dependency:tree -Dscope filter is silently non-functional due to MSHARED-4
URL: https://github.com/apache/maven-dependency-plugin/issues/1649


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org