以下版本中存在冲突的跨版本后缀:org.scala-stm:scala-stm

时间:2013-10-18 17:42:37

标签: build playframework sbt

在我结束时,我有以下设置

C:>在哪里玩 C:\ APPS \播放2.2.0 \播放 C:\应用\播放2.2.0 \ play.bat

C:>其中scala C:\ APPS \斯卡拉\ BIN \斯卡拉 C:\应用\阶\ BIN \ scala.bat


Scala -version> Scala代码运行器版本2.10.2 - 版权所有2002-2013,LAMP / EPFL

播放 - 版本>

使用Scala 2.10.2(运行Java 1.7.0_21)构建2.2.0,http://www.playframework.com

这不是播放应用程序!

使用play new在当前目录中创建新的Play应用程序, 或转到现有应用程序并使用play启动开发控制台。

您还可以在http://www.playframework.com浏览完整的文档。


当我在我的播放提示下运行>重新加载,更新,我收到以下错误

[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] $

在Build.scala中添加以下内容后

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

获取以下错误

[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] $

4 个答案:

答案 0 :(得分:3)

这是Play上的一个已知问题:

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

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

尝试

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

或者如果它是另一个依赖于Play 2.1.x的lib,请尝试

//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")

答案 1 :(得分:3)

问题是,检测sbt中scala版本不匹配的方法是通过此工件扩展“_”。

这个特殊问题是Play所依赖的scala-stm版本声明它与兼容scala 2.10.0,而你的版本说它可以从2.10中获取任何内容。 x系列。 sbt发出警告说这些是不同的。

实际上,scala-stm工件实际上是安全的,它只是在发布时配置错误(我认为文档错误)。所以在这种情况下,忽略错误是安全的。但是,一般来说,应该认真对待这个错误。很有可能在工件上声明的不同Scala二进制版本号可能会导致RUNTIME错误(不是编译时间),这些错误潜伏在您的代码中。

您可以使用conflictWarning键来控制此消息的记录方式。我相信如果你想完全忽略警告(不推荐,因为大多数应该是合法的问题),那么你可以使用这个设置:

conflictWarning := ConflictWarning.disable

另外,我认为这与此问题重复:Conflicting cross-version suffixes in: com.twitter:util-core

答案 2 :(得分:1)

从Play 2.1。*升级到Play 2.2。*时出现了同样的错误。该项目包括secureSocial,还需要更新到Play 2.2。

"securesocial" %% "securesocial" % "2.1.0"

"ws.securesocial" %% "securesocial" % "2.1.3"

请参阅Secure Social Installation Documentation

答案 3 :(得分:1)

这取决于您的scala版本,例如我使用:

"com.typesafe.akka" % "akka-remote_2.11" % "2.3.6"

对于scala 2.11.1。 您可以从this link找到合适的版本。