I found a very fast and interesting tool to archive this goal:
http://tattletale.jboss.org/
Just unzip the program and run:
java -Xmx512m -jar tattletale.jar ~/myjavaproject/mydistribution output
This will generate a very impressive report with different points (text from their site):
- Identify dependencies between JAR files
- Find missing classes from the classpath
- Spot if a class/package is located in multiple JAR files
- Spot if the same JAR file is located in multiple locations
- With a list of what each JAR file requires and provides
- Verify the SerialVersionUID of a class
- Find similar JAR files that have different version numbers
- Find JAR files without a version number
- Find unused JAR archives
- Identify sealed / signed JAR archives
- Locate a class in a JAR file
- Get the OSGi status of your project
- Remove black listed API usage
- And generate the same reports for your .WAR and .EAR archives