zane昨天推薦個項目依賴分析的工具: http://www.jboss.org/tattletale
JBoss Tattletale is a tool that can help you get an overview of the project you are working on
or a product that you depend on.
The tool will provide you with reports that can help you
* 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 files
* Identify sealed / signed JAR archives
* Locate a class in a JAR file
* Get the OSGi status of your project
or a product that you depend on.
The tool will provide you with reports that can help you
* 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 files
* Identify sealed / signed JAR archives
* Locate a class in a JAR file
* Get the OSGi status of your project
使用方法
java -Xmx512m -jar tattletale.jar [-exclude=<excludes>] <scan-directory> [output-directory]
注意事項
tattletale只分析jar包之間的依賴,需要自己把所有的class文件打包放入scan-directory,然后把依賴的lib也放入同個目錄