How can I determine if a Maven dependency is never used in a project?

What I want is to view some plot with relations between Maven dependencies and classes in my project. Thus I want to find out which dependenies are used and how, and which are not.

Is there a way to do it in Idea?

I run simple mvn dependency:analyze, and it show mea number of unused and used dependenies. May be, Idea can do it in a more convinient manner?

I am using Idea 13 Ultimate.

4 comments
Comment actions Permalink

use the Maven dependency plugin, specifically the Dependency:Analyze goal.

 

<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>analyze</id>
<goals>
<goal>analyze-only</goal>
</goals>
<configuration>
<failOnWarning>true</failOnWarning>
<outputXML>true</outputXML>
</configuration>
</execution>
</executions>
</plugin>
0
Comment actions Permalink

How should the

maven-dependency-plugin

be added to the maven pom.xml file? Which section should it go to? The xml code above is different from the code found in https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-dependency-plugin/2.8 and it seems they fit in different sections of the pom file.

 

 

0

Please sign in to leave a comment.