Fork me on GitHub
#leiningen
<
2019-08-28
>
enn15:08:25

Do version numbers specified in managed dependencies apply to transitive dependencies? That is, if I specify [foo "0.2.0"] in :managed-dependencies in my project, and also have a dependency on a third-party library bar which depends on [foo "0.1.0"], will Leiningen/Maven use 0.1.0 or 0.2.0?

mikerod15:08:35

@enn I believe that is the case, but have to dig a bit to see that

mikerod15:08:41

should be a really easy test case to try out though

mikerod16:08:59

@enn

(defproject mikerod/demo-it "0.1.0-SNAPSHOT"
  :managed-dependencies [[commons-codec "1.13"]] ;; clj-http uses `[commons-codec "1.10"]` transitively
  :dependencies [[clj-http "3.7.0"]])
lein deps :tree
[clj-http "3.7.0"]
   [commons-codec "1.13" :exclusions [[org.clojure/clojure]]]
(defproject mikerod/demo-it "0.1.0-SNAPSHOT"
  ;;:managed-dependencies [[commons-codec "1.13"]] ;; <---- commented this out to show diff

  :dependencies [[clj-http "3.7.0"]])
lein deps :tree
[clj-http "3.7.0"]
   [commons-codec "1.10" :exclusions [[org.clojure/clojure]]]
lein -v
Leiningen 2.8.3 on Java 1.8.0_112 Java HotSpot(TM) 64-Bit Server VM
I don’t think this has changed any time recently either.

mikerod16:08:00

it mostly comes down to the com.cemerick/pomegranate impl’s use of the underlying org.eclipse.aether/aether lib

mikerod16:08:09

I do wish this was documented more clearly

mikerod16:08:21

or had a test case in leiningen-core tests, but I don’t see one

enn16:08:09

Nice, thank you. That's what I was hoping.

🎉 4