sbt resolves dependencies differently with/without coursier
See original GitHub issueHi,
Since sbt switched to Coursier I’ve faced with the issue described in https://github.com/sbt/sbt/issues/5389. It looks like the root cause of the issue is a different classpath we get using Ivy and Coursier.
So, here is a problem repo https://github.com/rusexpertiza-llc/yupana. The subproject is hbase
. Here is the diff between Ivy dependencies and Coursier:
- guava-12.0.1.jar
+ guava-16.0.1.jar
+ hadoop-mapreduce-client-core-2.5.1.jar
+ hadoop-yarn-api-2.5.1.jar
+ hadoop-yarn-common-2.5.1.jar
+ jline-0.9.94.jar
+ netty-3.7.0.Final.jar
- protobuf-java-2.6.1.jar
+ protobuf-java-3.8.0.jar
+servlet-api-2.5-20081211.jar
One of the problems I see here is that forced version for protobuf-java
is ignored.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Version handling - Coursier
Version reconciliation happens when two or more of your direct or transitive dependencies depend on different versions of the same module.
Read more >Better management of transitive dependencies and conflicts
By default, both Ivy and coursier tolerate that the dependency graph contains two different versions of a library, in which case they pick...
Read more >SBT with 1.3.7 coursier fails to resolve dependency ... - GitHub
I confirm that sbt-google-cloud-storage can't work out-of-the-box with coursier. It relies on a custom resolver class, which is not supported by ...
Read more >sbt Reference Manual — Library Management
sbt 1.3.0+ uses Coursier to implement dependency management. ... what to do when dependency resolution brings in different versions of the same library....
Read more >semantics of dependency resolvers - eed3si9n
A dependency resolver, or package manager, is a program that ... out, Coursier orders version number in a completely different way from Ivy....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s interesting that the dependency resolution differences seem to be around Hadoop related things. For example, if you look at
cs resolve org.apache.hadoop:hadoop-common:2.9.2 -t
, you’d see the libraries that are mentioned here likenetty-3.7.0.Final
andnimbus-jose-jw
.It would be good to compare not just Ivy vs Coursier, but also the resolution result of Maven as well because some of the differences could be coming from the fact that Coursier is doing a better job emulating Maven, especially when it comes to traversing the parent POMs.
Hadoop depends on Apache Curator Framework. https://repo1.maven.org/maven2/org/apache/curator/curator-framework/2.7.1/curator-framework-2.7.1.pom At a glance it doesn’t look like it doesn’t depend on much:
but wait there’s more…
Here’s the parent POM - https://repo1.maven.org/maven2/org/apache/curator/apache-curator/2.7.1/apache-curator-2.7.1.pom
That’s Guava 16 and Zookeeper 3.4.6. Hadoop also depends on Zookeeper but with excludes. Curator doesn’t have those excludes.
What does Zookeeper 3.4.6 depend on? https://repo1.maven.org/maven2/org/apache/zookeeper/zookeeper/3.4.6/zookeeper-3.4.6.pom
That’s right JLine 0.9.94 and Netty 3.7.0.Final.
I mean you probably don’t need those (and that’s why Hadoop excludes them), but when I see extra JLine or Netty, I usually assume that Coursier is being correct.
upgraded from sbt 1.3.4 to 1.4.7 (required because im on a new M1 MacBook Air)… I’ve noticed major differences between the coursier and ivy classpaths as well…
for example my project depends on
com.microsoft.azure:msal4j:1.8.0
that lib depends oncom.nimbusds:oauth2-oidc-sdk:7.4
which depends oncom.nimbusds:nimbus-jose-jwt:8.14.1
coursier doesn’t even download either of those two jars nor add them to the classpath…
I had to disable coursier to get my project to function.
ThisBuild / useCoursier := false
seems odd to rewrite dependency management when maven/ivy are tried and trued…