Fork me on GitHub

it happened again. when i've added the :mvn/local-repo "m2" to my deps.edn and ran time clj -e 1 for the 1st time, i've only seen some of the dependencies being printed, while it was actually downloading all of them:

Downloading: ring/ring-jetty-adapter/1.6.3/ring-jetty-adapter-1.6.3.pom from 
Downloading: crypto-equality/crypto-equality/1.0.0/crypto-equality-1.0.0.jar from 
Downloading: potemkin/potemkin/0.4.5/potemkin-0.4.5.jar from 

real    1m42.094s
user    0m16.879s
sys     0m0.933s

raven:reap onetom$ du -hsc m2
22M     m2
22M     total


after an rm -r m2, on subsequent run, i could see all of the deps printed as they were being downloaded and the size of the maven cache ended up being the same:

raven:reap onetom$ rm -r m2
raven:reap onetom$ time clj -Sforce -e 1
Downloading: org/clojure/data.json/0.2.6/data.json-0.2.6.pom from 
Downloading: com/google/code/gson/gson/2.7/gson-2.7.jar from 

real    0m38.062s
user    0m16.855s
sys     0m1.167s

raven:reap onetom$ du -hsc m2
22M     m2
22M     total
something, somewhere might be caching these artefacts, because the 2nd time was so much faster... but MAYBE the first time is slower because of the same bug, which causes only a few of the downloaded dependencies being printed!


for the record, my deps.edn looks like this:

{:paths     ["src" "rsc" "java" "classes"]
 :deps      {org.clojure/clojure                    {:mvn/version "1.10.1"}
             clj-http                               {:mvn/version "3.10.0"}
             cheshire                               {:mvn/version "5.1.1"}
             org.clojure/data.json                  {:mvn/version "0.2.6"}
             com.squareup.wire/wire-runtime         {:mvn/version "3.0.0-rc01"}
         {:mvn/version "3.9.1"}
    {:mvn/version "3.9.1"}
             zprint                                 {:mvn/version "0.4.16"}
             ring/ring-core                         {:mvn/version "1.7.1"}
             ring/ring-devel                        {:mvn/version "1.7.1"}
             ring/ring-jetty-adapter                {:mvn/version "1.6.3"}
             aleph                                  {:mvn/version "0.4.6"}
             compojure                              {:mvn/version "1.6.1"}
             hiccup                                 {:mvn/version "1.0.5"}
             ;org.clojure/clojurescript              {:mvn/version "1.10.520"}
 :aliases   {:test {:extra-paths ["test"]
                    :extra-deps  {
                                  ;clj-http-fake {:mvn/version "1.0.3"}
 :mvn/local-repo "m2"
 :mvn/repos {"central" {:url
             "clojars" {:url ""}}}


and my clj version info looks like this:

raven:reap onetom$ time clj -Sverbose -e 1
version      =
install_dir  = /nix/store/bqs5l2mc2jlj5z1a21ix0sz0ak8cvn0l-clojure-
config_dir   = /Users/onetom/.clojure
config_paths = /nix/store/bqs5l2mc2jlj5z1a21ix0sz0ak8cvn0l-clojure- /Users/onetom/.clojure/deps.edn deps.edn
cache_dir    = .cpcache
cp_file      = .cpcache/1871601414.cp


real    0m0.858s
user    0m2.045s
sys     0m0.131s


/Users/onetom/.clojure/deps.edn is all commented out


Is it possible to just download the dependencies of my project, without running anything? Like with lein deps.


Doing -Spath will print the classpath, and won't execute anything.


Nice trick, thanks!