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
  • 100,966
  • 191
  • 140
  • 197
Null Pointer
  • 255
  • 1
  • 5
  • 21

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,159
  • 17
  • 27
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
  • 7,460
  • 1
  • 19
  • 23