Coderer
Coderer

Reputation: 27334

How can I see a `dependency:tree` for artifacts only used in non-default lifecycle steps?

I have a Maven project with a number of dependencies. I can run mvn dependency:tree to get a dump of all the artifacts that I depend on, plus their transitive dependencies, etc, turtles all the way down. However, I can sometimes run a non-default lifecycle goal like rpm:rpm or javadoc:javadoc and it will complain about missing an artifact that wasn't listed in dependency:tree. Is there a way to tell Maven "calculate dependencies as if you were going to run goal X:Y, then give me a dependency tree for that"? Am I missing something?

Upvotes: 0

Views: 1348

Answers (1)

Ryan Stewart
Ryan Stewart

Reputation: 128949

You're talking about running plugin goals, not lifecycle phases. Plugins have their own dependencies that are unrelated to the project dependencies. If you run Maven with verbose output (-X/--debug command line option), it will show you the dependency trees of all the plugins. This is the only way I've ever found to see a plugin's dependencies. The output is huge, and it will take you a while to orient yourself the first time through, but the trees are pretty obvious when you find them. Try searching for occurrences of the plugin's artifactId. That will get you where you want to be.

Upvotes: 1

Related Questions