Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Conflicting cross-version suffixes in: org.scala-stm:scala-stm

At my end, I have the following setup

C:>where play C:\apps\play-2.2.0\play C:\apps\play-2.2.0\play.bat

C:>where scala C:\apps\scala\bin\scala C:\apps\scala\bin\scala.bat


Scala -version > Scala code runner version 2.10.2 -- Copyright 2002-2013, LAMP/EPFL

Play - version >

play 2.2.0 built with Scala 2.10.2 (running Java 1.7.0_21), http://www.playframework.com

This is not a play application!

Use play new to create a new Play application in the current directory, or go to an existing application and launch the development console using play.

You can also browse the complete documentation at http://www.playframework.com.


When I run at my play prompt > reload, update, I get following error

[error] Modules were resolved with conflicting cross-version suffixes in     {file:/C:/<filepat>}<appname>:
[error]    org.scala-stm:scala-stm _2.10, _2.10.0
[trace] Stack trace suppressed: run last *:update for the full output.
[error] (*:update) Conflicting cross-version suffixes in: org.scala-stm:scala-stm
[error] Total time: 7 s, completed Oct 18, 2013 1:33:41 PM
[modelingApp] $

After adding the follwoing in Build.scala

"dependencyGroupId"         %% "dependencyArtifactId" % "dependencyVersion"    exclude("org.scala-stm", "scala-stm_2.10.0")

Get following error

[trace] Stack trace suppressed: run last *:update for the full output.
[error] (*:update) sbt.ResolveException: unresolved dependency:       dependencyGroupId#dependencyArtifactId_2.10;dependencyVersion: not found
[error] Total time: 8 s, completed Oct 18, 2013 1:22:18 PM
[modelingApp] $
like image 354
RCR Avatar asked Oct 18 '13 17:10

RCR


2 Answers

The issue is that the only means of detecting scala version mismatch in sbt is via this artifact extension "_".

This particular issue is that the version of scala-stm that Play is depending on is declaring it is ONLY compatible with scala 2.10.0, whereas your build says it can take anything from the 2.10.x series. sbt is issuing a warning that these are different.

In practice, the scala-stm artifact is actually safe to use, it's just misconfigured on publish (documentation error at the time I believe). So in this case, it's safe to ignore the error. however, in general, this error should be taken seriously. It's very possible that different Scala binary version numbers declared on artifacts may lead to RUNTIME errors (not compile time) that insidiously sneak into your code.

You can use the conflictWarning key to control how this message is logged. I believe if you want to ignore the warnings completely (not recommended, as most should be legitimiate issues), then you can use this setting:

conflictWarning := ConflictWarning.disable

Also, I believe this is a duplicate of this question: Conflicting cross-version suffixes in: com.twitter:util-core

like image 145
3 revs Avatar answered Nov 01 '22 05:11

3 revs


It is a known issue on Play:

Conflicting cross-version suffixes in: org.scala-stm:scala-stm

Maybe you use play slick that is not ready for Play 2.2.

Try

"com.typesafe.play" %% "play-slick" % "0.5.0.2-SNAPSHOT"

Or if it is another lib that has a dependency to Play 2.1.x, try

//replace the name and versions with that of your library
//since Scala 2.10.0 do not put the minor version into the artifact name:
//scala-stm_2.10 instead of scala-stm_2.10.0
"the lib vendor" %% "name" % "version" exclude("org.scala-stm", "scala-stm_2.10.0")
like image 43
Schleichardt Avatar answered Nov 01 '22 04:11

Schleichardt