Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I find which of my dependencies is downloading a particular jar?

Tags:

One of my project.clj's :dependencies is dependent on the monolithic clojure-contrib-1.1.0.jar, but I can't guess which one is downloading it. Short of incrementally commenting out each one, how can I discover which of them is responsible ?

like image 907
Hendekagon Avatar asked Apr 01 '12 23:04

Hendekagon


People also ask

How do I check the dependencies of a JAR file?

jar file. Use the -verbose:class option to find class-level dependencies or use the -v or -verbose option to include dependencies from the same JAR file. Use the -R or -recursive option to analyze the transitive dependencies of the com.

How do you find transitive dependencies?

You can get this information in the Maven Tool Window. First go to View → Tool Windows → Maven, to make sure that the Maven window is visible. The top-level elements in the tree are your direct dependencies, and the child elements are the transitive dependencies.

Does a JAR file contain all dependencies?

the executable jar should NOT contain the dependencies, just enough of your own code to run, with the dependent classes coming from the before mentioned classpath set up in the manifest.


2 Answers

This is available in leiningen now as lein deps :tree

See here for an example

like image 71
sw1nn Avatar answered Sep 27 '22 20:09

sw1nn


I'm not sure if there's a more Clojure-y solution, but you can run lein pom to generate a Maven POM, and then run mvn dependency:tree to display a tree of the projects dependencies.

like image 28
Hugh Avatar answered Sep 27 '22 20:09

Hugh