Conflicting cross-version suffixes (sbt, Scala-STM, Play-JSON)
Solution 1
You can get around this by removing scala-stm with exclude
"dependencyGroupId" %% "dependencyArtifactId" % "dependencyVersion" exclude("org.scala-stm", "scala-stm_2.10.0")
Do not forget to do sbt clean
.
Solution 2
If you'd like to see all libraries being pulled in to your SBT project, you can use the SBT dependency graph plugin.
Using this, you can see why scala-stm is being pulled in, and also check for other conflicting scala 2.10 and 2.11 dependencies.
Solution 3
Updated Play2 2.2 - downgrading to SBT from 0.13.0 -> 0.12.4 didn't work with me, but excluding using exclude("org.scala-stm", "scala-stm_2.10.0") on ALL app-specific dependencies I had worked fine -- anyway -- none of my dependencies shouldn't have anything to do with scala-stm.
Related videos on Youtube
0__
Updated on June 13, 2022Comments
-
0__ almost 2 years
I am using a JSON extension which relies on Mandubian's play-json 2.2-SNAPSHOT. Everything worked fine until now I have a project based on Scala-STM. sbt reports the following problem:
[error] Modules were resolved with conflicting cross-version suffixes in {file:folder}project: [error] org.scala-stm:scala-stm _2.10, _2.10.0 java.lang.RuntimeException: Conflicting cross-version suffixes in: org.scala-stm:scala-stm
Is there any chance to dig deeper into where these two "conflicting" versions come from? I am quite surprised that play-json should be depending on scala-stm?!
Furthermore, is there a way to convince sbt to shut the ... up. Because obviously 2.10 and 2.10.0 are equivalent versions.
EDIT: This seems to be an sbt 0.13 bug (and probably has nothing to do with Play-JSON), because if I revert to 0.12.4, the project successfully updates and builds. I am still interested in a work around for sbt 0.13.
-
Kevin Meredith over 10 yearsRather than use Mandubian's play-json SNAPSHOT, why not just add this dependency -
"play % "play_2.10" % "2.1.0"
per my question - stackoverflow.com/questions/19436069/… -
Channing Walton over 10 yearsI am not sure it is a bug. I saw this problem too after upgrading, but then discovered that there were indeed two different versions of a library being used. It might be useful to turn it down to a warning I guess.
-
-
0__ over 10 yearsSo are you saying you had the same issue with Play 2.2?
-
Jukka Nikki over 10 yearsExactly. Problem occured when I was switching from Play2 2.1 to 2.2, before that all was fine with 0.12.4 and Play2 2.1
-
Kevin Meredith over 10 yearsWhere do I add this in my
play
app? I presumeBuild.scala
, but where inside of it? -
kompot over 10 years
Build.scala
for a newly created project (Play 2.1.x, as 2.2 does not use Build.scala anymore) contains variableval appDependencies
that contains aSeq
with dependencies. Right inside of it. -
Paul Draper almost 10 years@kompot, Play 2.2 and 2.3 can be used with either
build.sbt
orBuild.scala
. -
0__ over 9 yearsThanks, I have this plugin now globally installed and use it a lot. A good recommendation.
-
jsky over 9 yearsthat would be nice. but this plugin didnt work for me: "cannot resolve symbol virtual" in the line
net.virtualvoid.sbt.graph.Plugin.graphSettings
-
Jon Onstott over 9 years@jsky That line should be in /build.sbt instead of /project/build.sbt. Is that the case in your build? Or use the alternative approach mentioned here: github.com/jrudolph/sbt-dependency-graph#how-to-use
-
samthebest over 9 yearsWhat exactly does
exclude
do, it seems to be a catch all solution to when sbt is being a moron. Surely there has to be some consequences? -
matanster over 8 yearsexclude is described in scala-sbt.org/0.13/docs/Library-Management.html