jdependency is small library that helps you analyze class level dependencies, clashes and missing classes.
Check the documentation on how to use it with javadocs and a source xref is also available.
The jars are available on maven central. The source releases you can get in the download section.
If feel adventures or want to help out feel free to get the latest code via git.
git clone git://github.com/tcurdt/jdependency.git
final Clazzpath cp = new Clazzpath();
cp.addClazzpathUnit(jar1, "jar1.jar");
cp.addClazzpathUnit(jar2, "jar2.jar");
final Set<Clazz> clashed = cp.getClashedClazzes();
for(Clazz clazz : clashed) {
System.out.println("class " + clazz + " is contained in " + clazz.getClasspathUnits());
}
final Clazzpath cp = new Clazzpath();
cp.addClazzpathUnit(jar1, "jar1.jar");
final Set<Clazz> missing = cp.getMissingClazzes();
for(Clazz clazz : missing) {
System.out.println("class " + clazz + " is missing");
}
final Clazzpath cp = new Clazzpath();
final ClazzpathUnit artifact = cp.addClazzpathUnit(jar1, "artifact.jar");
cp.addClazzpathUnit(jar2, "dependency.jar");
final Set<Clazz> removable = cp.getClazzes();
removable.removeAll(artifact.getClazzes());
removable.removeAll(artifact.getTransitiveDependencies());
for(Clazz clazz : removable) {
System.out.println("class " + clazz + " is not required");
}
- jarjar
- proguard
- maven-shade-plugin
- maven-minijar-plugin (discontinued)
All code and data is released under the Apache License 2.0.