Finding unused cans used in the eclipse project

Are there any plugins / tools for passing through the path to the eclipse project classes (or workspace) and highlight all unused banks?

+57
java eclipse jar
Oct 29 '08 at 10:00
source share
5 answers

ClassPathHelper is a good start.

It automatically identifies orphaned banks and more.

The only limitation is dependencies that are not defined in classes, for example. in dependency injection infrastructure configuration files.

You also have other options / additions, for example:

  • workfrog "Relief" , which relies on the ability to cope with real objects, examining their shape, size or relative place in space, which he gives a "physical" idea of โ€‹โ€‹Java packages, types and fields and their relationships, which simplifies their processing.
  • Unnecessary code detector : an eclipse plugin tool for finding unnecessary (dead) open Java code.
+41
Oct 29 '08 at 22:11
source share

UCDetector does not help for this: it does not work in JAR. And for classpathHelper, I could not find an easy way to simply specify JAR orphans (BTW, if anyone has a tutorial for this, I am interested).

So, if you also use Maven like me, I will recognize this great Maven plugin , and I would like to share this solution with you. Just enter:

mvn dependency:analyze 

And you will immediately get a list of unused JARs in your dependencies. Very comfortably!

+26
Mar 16 2018-11-11T00:
source share

You can use one of the following plugins: UCDetector or Class Helper

+7
Oct 29 '08 at 22:22
source share

I found a very fast and interesting tool for archiving this purpose:

http://tattletale.jboss.org/

Just unzip the program and run:

 java -Xmx512m -jar tattletale.jar ~/myjavaproject/mydistribution output 

This will create a very impressive report with different points (text from your website):

  • Define dependencies between JAR files
  • Search for missing classes from the class path
  • Spot if the class / package is in multiple JAR files
  • Spot if the same JAR file is in multiple places.
  • With a list of what each JAR file requires and provides
  • Check SerialVersionUID class
  • Find similar JAR files with different version numbers
  • Find JAR files without version number
  • Find Unused JAR Archives
  • Identify JAR archives signed / signed.
  • Find the class in the JAR file
  • Get the OSGi status of your project
  • Remove Black Listed API Usage
  • And create the same reports for your .WAR and .EAR archives.
+5
Jul 23 '15 at 9:13
source share

I know this is old, but if anyone else stumbles upon it, Eclipse will do it on its own.

Go to project properties -> Java Code Style -> Cleanup Select Eclipse [Built-in] and do the following:

  • Changing non-static access to static members using an ad type
  • Change indirect access to static members for direct access (access through subtypes)
  • Delete unused import resources
  • Add missing @Override annotations
  • Add missing @Override annotations to the Methods interface implementations
  • Add missing "@Deprecated" annotations
  • Remove unwanted casts
  • Remove Unnecessary $ NON-NLS $ Tags
0
Feb 11 '13 at 13:12
source share



All Articles