解决 Scala SBT 中的导入冲突
Resolving import conflicts in Scala SBT
我正在尝试遵循此 tutorial,但我两天都遇到同样的错误。我在 SO 中发现了一些类似的问题,但其中任何一个都对我有所帮助(可能是因为我对 scala 和 sbt 缺乏了解)。
这是我的build.sbt
name := "fitman"
version := "1.0"
scalaVersion := "2.11.6"
lazy val versions = new {
val finatra = "2.1.2"
val logback = "1.1.3"
}
resolvers ++= Seq(
Resolver.sonatypeRepo("releases"),
"Twitter Maven" at "https://maven.twttr.com"
)
libraryDependencies += "com.twitter.finatra" %% "finatra-http" % versions.finatra
libraryDependencies += "com.twitter.finatra" %% "finatra-slf4j" % versions.finatra
libraryDependencies += "ch.qos.logback" % "logback-classic" % versions.logback
这是我试图理解的警告:
SBT project import
[warn] Scala version was updated by one of library dependencies:
[warn] * org.scala-lang:scala-library:(2.11.6, 2.11.4, 2.11.0, 2.11.2) -> 2.11.7
[warn] To force scalaVersion, add the following:
[warn] ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) }
[warn] Run 'evicted' to see detailed eviction warnings
[warn] Multiple dependencies with the same organization/name but different versions. To avoid conflict, pick one version:
[warn] * org.scala-lang:scala-library:(2.11.7, 2.11.6)
[warn] * org.scala-lang:scala-reflect:(2.11.7, 2.11.6)
[warn] * org.scala-lang.modules:scala-parser-combinators_2.11:(1.0.4, 1.0.3)
[warn] * org.scala-lang.modules:scala-xml_2.11:(1.0.5, 1.0.3)
您使用的其中一个库需要 Scala 2.11.7,因此 SBT 将用它覆盖您的 scalaVersion
设置。更新构建文件中的 Scala 版本:
scalaVersion := "2.11.7"
我正在尝试遵循此 tutorial,但我两天都遇到同样的错误。我在 SO 中发现了一些类似的问题,但其中任何一个都对我有所帮助(可能是因为我对 scala 和 sbt 缺乏了解)。
这是我的build.sbt
name := "fitman"
version := "1.0"
scalaVersion := "2.11.6"
lazy val versions = new {
val finatra = "2.1.2"
val logback = "1.1.3"
}
resolvers ++= Seq(
Resolver.sonatypeRepo("releases"),
"Twitter Maven" at "https://maven.twttr.com"
)
libraryDependencies += "com.twitter.finatra" %% "finatra-http" % versions.finatra
libraryDependencies += "com.twitter.finatra" %% "finatra-slf4j" % versions.finatra
libraryDependencies += "ch.qos.logback" % "logback-classic" % versions.logback
这是我试图理解的警告:
SBT project import
[warn] Scala version was updated by one of library dependencies:
[warn] * org.scala-lang:scala-library:(2.11.6, 2.11.4, 2.11.0, 2.11.2) -> 2.11.7
[warn] To force scalaVersion, add the following:
[warn] ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) }
[warn] Run 'evicted' to see detailed eviction warnings
[warn] Multiple dependencies with the same organization/name but different versions. To avoid conflict, pick one version:
[warn] * org.scala-lang:scala-library:(2.11.7, 2.11.6)
[warn] * org.scala-lang:scala-reflect:(2.11.7, 2.11.6)
[warn] * org.scala-lang.modules:scala-parser-combinators_2.11:(1.0.4, 1.0.3)
[warn] * org.scala-lang.modules:scala-xml_2.11:(1.0.5, 1.0.3)
您使用的其中一个库需要 Scala 2.11.7,因此 SBT 将用它覆盖您的 scalaVersion
设置。更新构建文件中的 Scala 版本:
scalaVersion := "2.11.7"