2

I am creating maven project in which I added many jars. Now I want to delete some jars from project which are unused. But I am not able to identify which are unused. So can any one provide me simple way to identify and remove those unused jar. I saw some solutions but that are not working for me.

Mark Rotteveel
  • 90,369
  • 161
  • 124
  • 175
Null Pointer
  • 215
  • 5
  • 20

2 Answers2

4

First remove unused imports from your source code. In Eclipse it is Source -> Organize Imports. Then you could use the Maven dependency analyzer by running mvn dependency:analyze-only. It will produce a report identifying, i.a., unused dependencies.

Jonathan Rosenne
  • 2,083
  • 18
  • 25
0

You can use maven dependency:analyze to detect un used dependencies. But it wont remove anything.

http://maven.apache.org/plugins/maven-dependency-plugin/analyze-mojo.html

miskender
  • 6,867
  • 1
  • 17
  • 22