Code Monkey home page Code Monkey logo

jdependency's Introduction

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.

jdependency's People

Contributors

krosenvold avatar mbenson avatar olamy avatar tcurdt avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.