Denxah129
Denxah129

Reputation: 23

How to list all dependencies of a package from maven (including scopes)

I have a graph with 40K artifacts and I can list all possible dependencies of a package (I do so by parsing a list of effective poms)

For example, I have the following for this package:enter image description here

There's 2 dependencies without taking in mind different versions. I would like to show that this results are valid by showing that maven also lists these dependencies for this package. But when I use mvn dependency:tree after I add the com.google.guava:guava:14.0.1, I get no dependencies listed.

This is the pom file of the package:enter image description here

It clearly has those 2 dependencies, but their scopes are provided. Even if I use -Dinclude=provided or -Dscope=provided as a parameter, I still cannot list them. So, how do I list all dependencies of a package no matter the scope used?

Upvotes: 0

Views: 1126

Answers (2)

Andrey
Andrey

Reputation: 16391

Use Analyze Dependencies... action in the Maven tool window:

enter image description here

It will show the list of dependencies in the project with their scopes and usages in project:

enter image description here

Upvotes: 1

Martin Zeitler
Martin Zeitler

Reputation: 76699

Scope provided means it's provided at runtime, which implies that it's not a package dependency:

A dependency with this scope is added to the classpath used for compilation and test, but not the runtime classpath. It is not transitive.

Upvotes: 0

Related Questions