How to check if any of my classes use dependency and list in Maven?

I want to do some cleanup in POM.XML. How can I check which dependencies are not used at all by my code, and if it is used, then how to determine which one?

Of course, I don’t want to just remove the dependency, and then look for errors in the IDE, because it can take years when pom had about 80+ dependencies.

I am using the SpringSource Tools Suite for Eclipse.

Greetz

+6
source share
1 answer

Check out the Maven Dependency Plugin . At startup, it should list the dependencies that you have declared, but are not using, but also which non-transitional dependencies you use, without explicitly declaring them. Please note that you are using reflection; the report may not be accurate.

+8
source

Source: https://habr.com/ru/post/914305/


All Articles