Fork me on GitHub

If I try lein ancient after incorporating lein-tools-deps in my project.clj it always tells me that the artifacts are up-to-date. What do I need to do to get lein ancient work with lein-tools-deps? Thanks.


@dorab because with lein-tools-deps you're storing your deps in deps.edn, I'd recommend you use a tool that targets deps.edn directly. So far I only know of, but it works great


Did exactly what I wanted.


how alpha is add-lib? It fails for me like:

eggshell.controller> (deps/add-lib 'spec-provider {:mvn/version "0.4.14"})
eggshell.controller> (require 'spec-provider.provider)
FileNotFoundException Could not locate spec_provider/provider__init.class or spec_provider/provider.clj on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.  clojure.lang.RT.load (


If I try to add-lib again, it returns false


which means that it didn’t have to add it again


@stathissideris don't know why that's happening, buut, you need to be under a DynamicClassLoader for it to work.


I’m not even sure what that means 🙂


I’m in a REPL, is that ok?


add-lib is very alpha


@hiredman sounds like I have to wait for a bit longer before I integrate it into my app


@stathissideris it is possible to change the class loader of a repl, I believe it's in the recent history.

Alex Miller (Clojure team)20:06:34

add-lib works by finding the highest dynamic class loader in the current classloader chain and altering its loader sources

Alex Miller (Clojure team)20:06:06

Some repl contexts do not have a shared dcl above all repl invocations

Alex Miller (Clojure team)20:06:53

So changing it would not necessarily have any effect, I think nrepl creates a new context on every evaluation

Alex Miller (Clojure team)20:06:50

Using clj repl works for me but nrepl things I’ve tried do not


we've been talking about how to fix this in nrepl.

Alex Miller (Clojure team)20:06:15

Just need a dcl shared by all evals


@alexmiller I’m trying to integrate add-lib to my Swing app (and yes, I do realize it’s 2018 😄 ), the REPL entered the discussion because I naively thought that calling add-lib from the app would also make it available to the REPL I’m developing with


but having the new libs available in the repl is not essential to me


I may need to read up on classloaders, I call add-lib from within a future, would that make a difference?


@alexmiller this is the classloader chain within the future:

(#object[sun.misc.Launcher$AppClassLoader 0x42a57993 "sun.misc.Launcher$AppClassLoader@42a57993"] 
#object[sun.misc.Launcher$ExtClassLoader 0x4306c985 "sun.misc.Launcher$ExtClassLoader@4306c985"])
Starting with (.getContextClassLoader (Thread/currentThread)). So no DCL there, I guess that explains it


oh, setContextClassLoader!


@mfikes thanks, that looks like it may work 🙂


@mfikes @dominicm some progress! it seems that setting the classloader as @mfikes demonstrated allows add-lib to work, but the added lib is still not available to the part of the app that needs to use it, presumably because it doesn’t share the same DCL… but now at least I understand how it works and I may be able to fix it somehow


many thanks to all


@stathissideris Cool. IIRC, in the change linked above, I shoved that DCL in at the earliest possible moment.


(It is the very first bit of code executed in main, and my hope was that any threads spawned afterward would inherit it.)

Alex Miller (Clojure team)21:06:58

that should be the case


Just to check my understanding of this - is it the case that alembic no longer works under nREPL, because of the dynapath change for Java 9? Sounds like nREPL used to actually modify the URLClassLoader but can no longer do so?


Actually, I’ll ask this over in #nrepl