maven-dependency-plugin icon indicating copy to clipboard operation
maven-dependency-plugin copied to clipboard

[MDEP-927] dependency:tree excludes parameter does not work

Open jira-importer opened this issue 1 year ago • 1 comments

Seva Popov opened MDEP-927 and commented

The dependency:tree excludes parameter does not work in any plugin version available for download.

Ex.:

mvn org.apache.maven.plugins:maven-dependency-plugin:3.6.1:tree -s ~/.m2/settings.xml -Dexcludes=javax:javaee-api:jar:8.0.1  | grep javax.javaee

[INFO] +- javax:javaee-api:jar:8.0.1:provided

According to the documentation the dependency should have been excluded - https://maven.apache.org/plugins/maven-dependency-plugin/tree-mojo.html#excludes


Affects: 3.6.1

jira-importer avatar May 04 '24 01:05 jira-importer

Kariem Hussein commented

I have a similar problem and tried to describe it in this question on Stack Overflow.

Steps to reproduce

  1. Check out spring-ws, at version 4.0.11
  2. Change to directory spring-ws-core
  3. Run tree goal with scope filtered to runtime
mvn dependency:tree -Dscope=runtime
  1. Filter the output to exclude org.glassfish.jaxb:jaxb-runtime:jar:4.0.5
mvn dependency:tree -Dscope=runtime -Dexcludes=org.glassfish.jaxb:jaxb-runtime

→ The dependency is still included in the output, although it should have been filtered.

Filtering on jakarta.mail-api works witout problems

I have also tried this with version 3.8.0 of the plugin

mvn org.apache.maven.plugins:maven-dependency-plugin:3.8.0:tree ...

Also, I can reproduce the problem in version 2.8, which is the one implicitly used when running inside of spring-ws.

jira-importer avatar Oct 20 '24 19:10 jira-importer