8 commands that help to resolve maven dependency problems

Anish Antony
Javarevisited
Published in
4 min readJan 8, 2021

--

In your maven project, If the dependencies are placed not properly. This may result to create problems such as unused dependencies, duplicate dependencies, version conflicts…etc. These result execution failure of the project. Maven provides a set of commands to resolve these kinds of issues. Let's find out more about these commands as part of this article.

Photo by Markus Spiske on Unsplash

Here is the set of 8 important commands that resolves dependency related problems.

We are covering the commands such as dependency:tree, dependency: analyze, dependency:analyze-duplicate, dependency:build-classpath, dependency:resolve, dependency:sources, dependency:list-repositories, dependency:copy-dependencies

dependency:tree

Using this command, it is very easy to find out dependency conflicts. The command will output all the dependencies of your project in a tree structure so that it is easy to find out dependencies and their dependencies. This command helps find out a jar populated to your project as part of which dependency.

Let's move on to an example. Lets checkout dependency:tree for below pom.xml file

--

--

Anish Antony
Javarevisited

Fullstack Developer | Blogger | Experience on Java, Python, React, Angular, Golang | http://www.behindjava.com