jdependency

This project provides an API to analyse class dependencies

License

License

GroupId

GroupId

com.github.krosenvold
ArtifactId

ArtifactId

jdependency
Last Version

Last Version

0.8
Release Date

Release Date

Type

Type

jar
Description

Description

jdependency
This project provides an API to analyse class dependencies
Project URL

Project URL

http://github.com/krosenvold/jdependency
Source Code Management

Source Code Management

http://github.com/krosenvold/jdependency

Download jdependency

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.krosenvold/jdependency/ -->
<dependency>
    <groupId>com.github.krosenvold</groupId>
    <artifactId>jdependency</artifactId>
    <version>0.8</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.krosenvold/jdependency/
implementation 'com.github.krosenvold:jdependency:0.8'
// https://jarcasting.com/artifacts/com.github.krosenvold/jdependency/
implementation ("com.github.krosenvold:jdependency:0.8")
'com.github.krosenvold:jdependency:jar:0.8'
<dependency org="com.github.krosenvold" name="jdependency" rev="0.8">
  <artifact name="jdependency" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.krosenvold', module='jdependency', version='0.8')
)
libraryDependencies += "com.github.krosenvold" % "jdependency" % "0.8"
[com.github.krosenvold/jdependency "0.8"]

Dependencies

compile (6)

Group / Artifact Type Version
commons-io : commons-io jar 2.2
org.ow2.asm : asm jar 4.2
org.ow2.asm : asm-analysis jar 4.2
org.ow2.asm : asm-commons jar 4.2
org.ow2.asm : asm-util jar 4.2
org.ow2.asm : asm-tree jar 4.2

test (1)

Group / Artifact Type Version
junit : junit jar 4.10

Project Modules

There are no modules declared in this project.

jdependency - explore your classpath

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.

Where to get it

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

How to use it

finding classpath clashes

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());
}

finding missing classes

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");
}

finding unused classes

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");
}

Related projects

License

All code and data is released under the Apache License 2.0.

Versions

Version
0.8