How to determine which Maven dependency is needing a missing dependency?

maven, maven-dependency-plugin

Solution

There should be a better way, but if you run the command in debug mode (ie `-X` so the full command becomes `mvn -X dependency:tree`) then you'll see the trace printed out before the build dies:

    ...
[DEBUG]    org.springmodules:spring-modules-cache:jar:0.9:compile
[DEBUG]       opensymphony:oscache:jar:2.3:compile
[DEBUG]       tangosol:tangosol-coherence:jar:3.3-rc1:compile
[DEBUG]       oro:oro:jar:2.0.8:compile
[DEBUG]       org.apache.jcs:jcs:jar:1.3:compile
[DEBUG]          concurrent:concurrent:jar:1.0:compile
    ...

better answers are welcome.

Problem

I am trying to build an old Maven project and I'm getting the error: [ERROR] Failed to execute goal on project myapp: Could not resolve dependencies for project com.initech.myapp:war:${buildVersion}: Failure to find tangosol:tangosol-coherence:jar:3.3-rc1 in http://mvnrepo.initech.com/archiva/repository/initechrepo was cached in the local repository, resolution will not be reattempted until the update interval of initechrepo has elapsed or updates are forced -> [Help 1] I looked in the `pom.xml` of MyApp and there is no mention of "tangosol" and there is no parent POM so I figure this must be a transitive dependency. Normally, I can use the Maven Dependency plugin on the command line with `mvn dependency:tree` to display transitive dependencies. However, since the dependency is missing, the build fails and errors out instead of displaying the tree. How can I get the cause of missing transitive dependency even if the build is failing? EDIT: I am aware of why it failed, the artifact is missing from our local repository and the central repository, the question is which of my dependencies is asking for it.

Original source