1

I have a java project which is previously developed by another developer, in this application there are a lot of unnecessary libraries. I was able to delete some of those libraries. But, as there are a lot of them I want to know whether there is a technique to scan the project and detect unrelated libraries to the project.

Harsha
  • 3,548
  • 20
  • 52
  • 75

2 Answers2

1

I recommend Tattletale from JBoss.

smooth reggae
  • 2,189
  • 13
  • 14
0

Depending on the build method, it should be easy to remove unnecessary libraries without deleting/adding them by simply recompiling the application modifying the classpath at compile time, or rather modifying the build files by one-by-one deletion of lib dependencies. Either one of these methods will require no manual deletion of jars.

1) If you set the jars using the classpath manually, you can play with classpath wild cards to remove / add different jars when running : Setting multiple jars in java classpath classpaths . This does not require manual deletion / adding of jars.

2) Find the dependencies definition (pom.xml in maven, ivy.xml for some ant projects).

and One by one delete the (maven)

<dependency>..</dependency> 

or (ivy)

<dependency .... />

entries in your build file.

If you have the correct build plugins installed - then your IDE will immediately rebuild the project using your new definitions (no error prone removal/deletion of jars or classpath entries).

Community
  • 1
  • 1
jayunit100
  • 17,388
  • 22
  • 92
  • 167
  • oh, sorry, I forgot to tell that this is a swing application which is developed using netbeans IDE. – Harsha Mar 08 '12 at 03:11