Xodarap
Xodarap

Reputation: 11849

Display loaded dependencies in leiningen REPL

I'm running into problems because the library I have appears to conflict with the published documentation. I had a few problems with getting the right version of things installed before, and I'm wondering if this is the cause.

Is there any way to print out which jars were loaded in the repl so I can check?

Upvotes: 4

Views: 5624

Answers (4)

nha
nha

Reputation: 18005

There are several options:

  • using java interrop: (System/getProperty "java.class.path"), (println (seq (.getURLs (java.lang.ClassLoader/getSystemClassLoader))))
  • clojure/java.classpath contains useful functions: like system-classpath
  • lein: lein classpath and lein deps :tree
  • boot: boot show -p, as well as useful function in boot environnement. Maybe have a look at martinklepsch/boot-deps.

For boot, I also wrote nha/boot-deps that helps managing dependency conflicts.

Upvotes: 0

NielsK
NielsK

Reputation: 6956

You can also use query lein for

  • the classpath with lein classpath
  • a dependency tree printout with lein deps :tree

Upvotes: 16

Michiel Borkent
Michiel Borkent

Reputation: 34800

This might also help:

lein deps :tree - shows a tree of dependencies that get pulled in

[library "version" :exclusions [some-other-lib "version"]] - exclude the some-other-lib that gets pulled in by some library.

You can then manually pull in the right version of some-other-lib by defining your own dependency vector.

Upvotes: 6

Michał Marczyk
Michał Marczyk

Reputation: 84331

(System/getProperty "java.class.path")

Upvotes: 5

Related Questions