冲突的跨版本后缀(sbt、Scala-STM、Play-JSON)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19242450/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 05:44:41  来源:igfitidea点击:

Conflicting cross-version suffixes (sbt, Scala-STM, Play-JSON)

scalasbtdependency-management

提问by 0__

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:

我正在使用依赖于 Mandubian 的 play-json 2.2-SNAPSHOT 的 JSON 扩展。一切正常,直到现在我有一个基于 Scala-STM 的项目。sbt 报告以下问题:

[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?!

有没有机会深入挖掘这两个“冲突”版本的来源?我很惊讶 play-json 应该依赖于 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.

此外,有没有办法说服 sbt 关闭...闭嘴。因为显然 2.10 和 2.10.0 是等效的版本。



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.

编辑:这似乎是一个 sbt 0.13 错误(可能与 Play-JSON 无关),因为如果我恢复到 0.12.4,该项目将成功更新和构建。我仍然对 sbt 0.13 的解决方案感兴趣。

采纳答案by kompot

You can get around this by removing scala-stm with exclude

您可以通过使用 exclude 删除 scala-stm 来解决此问题

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

Do not forget to do sbt clean.

不要忘记做sbt clean

回答by Jukka Nikki

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.

更新 Play2 2.2 - 从 0.13.0 降级到 SBT -> 0.12.4 对我不起作用,但排除在所有特定于应用程序的依赖项上使用 exclude("org.scala-stm", "scala-stm_2.10.0")我工作得很好——无论如何——我的依赖项都不应该与scala-stm有任何关系。

回答by Jon Onstott

If you'd like to see all libraries being pulled in to your SBT project, you can use the SBT dependency graphplugin.

如果您希望看到所有库都被拉入您的 SBT 项目,您可以使用SBT 依赖关系图插件。

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.

使用它,您可以了解为什么要引入 scala-stm,并检查其他冲突的 Scala 2.10 和 2.11 依赖项。