I’ve been trying to use Maven to build a project. The project builds fine on a few computers I tried but on one machine, I’m having a random issue.
Essentially, maven is searching for a dependency that is not included in the pom.xml file or the in the settings.xml file at all.
I have tried mvn dependency:purge-local-repository but still no avail; I’m still stuck at mvn searching for a dependency I have no idea where it’s looking from.
If you run mvn dependency:tree on your project you’ll see where the unwanted dependency is being introduced, you can then exclude the dependency.
This is an example of the output:
To exclude a dependency, you’d do something like this:
For more details on the dependency plugin see the documentation.
For more details on exclusions, see the guide.
Update: You can also use the m2eclipse plugin to generate a graphical tree of the dependencies or as a graph.
dependency tree screenshot http://www.sonatype.com/books/m2eclipse-book/reference/figs/web/eclipse_pom-editor-depend-tree-locate.png
dependency graph screenshot http://www.sonatype.com/books/m2eclipse-book/reference/figs/web/eclipse_pom-editor-graph.png