Skip to content

[MDEP-829] excludes filter should function like exclusions #1334

Description

@jira-importer

Delany opened MDEP-829 and commented

The -Dincludes parameter causes the tree goal to filter the resultant dependency tree: it returns matching dependencies {}and their parents{}.

The -Dexcludes parameter uses the same logic, but returns non-matching dependencies {}and their parents{}. Why would anyone want this? Rather, excludes should remove matching dependencies from the initial dependency model (like dependency exclusions do), not just the resultant tree.

Include is demonstrated at https://maven.apache.org/plugins/maven-dependency-plugin/examples/filtering-the-dependency-tree.html, but not exclude.

If run the given exclude command

mvn dependency:tree -Dexcludes=org.codehaus.plexus

on the following tree

[INFO] org.apache.maven.plugins:maven-dependency-plugin:maven-plugin:2.0-alpha-5-SNAPSHOT
[INFO] \- org.apache.maven.doxia:doxia-site-renderer:jar:1.0-alpha-8:compile
[INFO]    \- org.codehaus.plexus:plexus-velocity:jar:1.1.3:compile
[INFO]       \- velocity:velocity:jar:1.4:compile

the output is the same, since the velocity dependency needs to show its parent in the tree. This is pointless. Why would I only want to exclude the "leaves" of the tree?


Affects: 3.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority:majorMajor loss of function

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions