In this post, we will see how to generate a report to list the unused dependencies of a Java project built using Maven.
We will use the dependency plugin to do so. Let's use the dependency:analyze-report goal as below
mvn dependency:analyze-report -DignoreNonCompile=true
This will basically generate an HTML report containing the list of dependencies with the following classification :
Ideally, it's always a good idea to cleanup the pom's by removing and/or commenting the unused but declared dependencies.
We will use the dependency plugin to do so. Let's use the dependency:analyze-report goal as below
mvn dependency:analyze-report -DignoreNonCompile=true
This will basically generate an HTML report containing the list of dependencies with the following classification :
- used and declared.
- used and undeclared.
- unused and declared.
Ideally, it's always a good idea to cleanup the pom's by removing and/or commenting the unused but declared dependencies.
No comments:
Post a Comment