Maven - Understanding dependencies used by a project

dependency tree

How to understand maven dependency tree for a project? Use this command to look at the dependency tree and make changes if necessary:

mvn dependency:tree

effective pom

To see the effective pom, use this:

mvn help:effective-pom

In IntelliJ, right click on pom.xml -> Maven -> Show effective POM

https://maven.apache.org/plugins/maven-help-plugin/effective-pom-mojo.html

https://maven.apache.org/plugins/maven-help-plugin/index.html

purge-local-repository

https://maven.apache.org/plugins/maven-dependency-plugin/purge-local-repository-mojo.html#:~:text=Description%3A,remove%20the%20manually%20given%20dependencies.

mvn dependency:purge-local-repository

Description:

When run on a project, remove the project dependencies from the local repository, and optionally re-resolve them. Outside of a project, remove the manually given dependencies.


Links to this note