Chip and Pin Credit Card System More DRY with Spring ServletContextPropertyPlaceholderConfigurer
Jan 03

Finding dependencies with JarJar

Tech Add comments

Chris Nokleberg has answered Hani’s desire for a simple tool to find dependencies between two codebases. He hacked JarJar to do just this.

He shows the example of:

$ java -jar jarjar.jar –find –level=jar j1.jar:j2.jar:j3.jar:j4.jar

giving you:

commons-beanutils-1.6.1.jar -> commons-collections-3.1.jar
commons-betwixt-0.5.jar -> commons-digester-1.5.jar
commons-betwixt-0.5.jar -> commons-beanutils-1.6.1.jar
commons-betwixt-0.5.jar -> commons-collections-3.1.jar
commons-cli-1.0.jar -> commons-lang-2.0.jar
commons-codec-1.2.jar -> commons-codec-1.3.jar
commons-dbcp-1.2.1.jar -> commons-pool-1.2.jar
commons-dbcp-1.2.1.jar -> commons-collections-3.1.jar
commons-digester-1.5.jar -> commons-collections-3.1.jar
commons-digester-1.5.jar -> commons-beanutils-1.6.1.jar
commons-jxpath-1.2.jar -> commons-beanutils-1.6.1.jar
commons-pool-1.2.jar -> commons-collections-3.1.jar
commons-validator-1.1.3.jar -> commons-collections-3.1.jar
commons-validator-1.1.3.jar -> commons-beanutils-1.6.1.jar
commons-validator-1.1.3.jar -> commons-digester-1.5.jar

Very nice. IMO, tools like these should be in the JDK itself. The graph that he has on his blog would also be very helpful.

In some ways I also would like to have a way to have a jar file show a dependency to another component library in a maven-esque way (I want the module foo, version 1.4) rather than Class-Path: /some/path/to/it. That would cut down on the libs that are laying around (although you end up having most of them in your MAVEN_REPO instead of all of your lib dirs if you go that way! Much better)

Leave a Reply

Spam is a pain, I am sorry to have to do this to you, but can you answer the question below?

Q: What are the first four letters in the word British?