【问题标题】:SBT: how to use scala 2.11 libraries in scala 2.12 projectSBT:如何在 scala 2.12 项目中使用 scala 2.11 库
【发布时间】:2017-03-15 09:53:58
【问题描述】:

我正在尝试升级我的项目以使用 scala 2.12 但是,我使用了一些没有 2.12 版本的库 (mongoquery-casbah, salat)。

如果我强制使用这些库的 2.11 版本 ("com.github.salat" % "salat_2.11" % "1.10.0", "com.github.limansky" % "mongoquery-casbah_2.11" % "0.5"),我收到错误:

[error] Modules were resolved with conflicting cross-version suffixes in {file:/C:/work/GeneASS/}dao:
[error]    org.scala-lang.modules:scala-parser-combinators _2.11, _2.12

我该如何解决这个问题?

【问题讨论】:

  • 简短的回答是,你不能。如果还没有,您可能希望为 repo 创建一个问题或拉取请求。

标签: scala sbt


【解决方案1】:

唯一的方法是为 scala 2.12 重新编译库。这当然要求库的任何传递依赖项也与 2.12 兼容。

Scala 源代码在版本之间大部分兼容,但编译后的字节码不兼容,因此您需要为要支持的每个 scala 版本构建单独的工件。

【讨论】:

    猜你喜欢
    • 2018-07-11
    • 2019-04-22
    • 2014-11-13
    • 2017-05-13
    • 2018-10-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-30
    相关资源
    最近更新 更多