Reputation: 748
My project is growing but i have many unused dependencies, how to find out, which one i really need, and which one is really useless? There is a some Intellij Idea Extensions?
Upvotes: 15
Views: 20813
Reputation: 10082
Add this plugin to your pom.xml
:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.5.0</version>
</plugin>
Then just run mvn dependency:analyze-report
.
Upvotes: 3
Reputation: 35805
You can run the Maven goal dependency:analyze
which lists the dependencies that are not used in your source code. Beware, though, that sometimes dependencies are necessary although they are not referenced in source code.
Upvotes: 17