Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How resolve version in duplicated transitive dependencies?

I am trying to build sbt project wiht command sbt clean compile here is an error:

[error] Modules were resolved with conflicting cross-version suffixes in {file:/C:/project-scala/}module:
[error]    org.json4s:json4s-ast _2.11, _2.10
[error]    org.json4s:json4s-jackson _2.11, _2.10
[error]    com.fasterxml.jackson.module:jackson-module-scala _2.11, _2.10
[error]    org.json4s:json4s-core _2.11, _2.10
[error]    org.json4s:json4s-native _2.11, _2.10
[error]    org.json4s:json4s-ext _2.11, _2.10
java.lang.RuntimeException: Conflicting cross-version suffixes in: org.json4s:json4s-ast, org.json4s:json4s-jackson, com.fasterxml.jackson.module:jackson-module-scala, org.json4s:json4s-core, org.json4s:json4s-native, org.json4s:json4s-ext

So it is obvious that there are duplicated dependencies with different versions but the real problem is that my project do not depend directly of they. There are chains (jackson is use just for example):

chain 1: myProject -> Somelib1 ->  jackson-module-scala _2.11
chain 2: myProject -> Somelib2 ->  jackson-module-scala _2.10

So how to figure out what are the actual Somelib1 and Somelib2?

ALSO I have tried to analyze dependencies, but sbt fails with error, see this question

like image 503
Cherry Avatar asked Oct 21 '22 02:10

Cherry


1 Answers

For some reason Somelib1 and Somelib2 depend on different version of scala. Did you forgot %%: sbt dependencies

Sbt has also version conflict managers, but you have different artifacts for different scala versions!: sbt conflict managers.

To see artifact dependency tree try sbt-dependency-graph plugin

like image 187
phadej Avatar answered Oct 23 '22 01:10

phadej