我刚刚添加了ScalaTest,build.sbt
所以它现在看起来如下:
name := "appname" version := "1.0" scalaVersion := "2.11.7" libraryDependencies ++= Seq( "com.typesafe.akka" %% "akka-actor" % "2.4.1", "org.scalatest" % "scalatest_2.11" % "2.2.4" % "test" )
之后我收到了警告信息:
SBT project import [warn] Multiple dependencies with the same organization/name but different versions. To avoid conflict, pick one version: [warn] * org.scala-lang:scala-reflect:(2.11.2, 2.11.7) [warn] * org.scala-lang.modules:scala-xml_2.11:(1.0.2, 1.0.4)
我也尝试将有关ScalaTest的行更改为:
"org.scalatest" %% "scalatest" % "2.2.4" % "test"
但警告仍然与上述相同.
我怎么能处理这个问题,因为我的项目中没有任何地方写过"反映"或"xml".我使用的是Akka和ScalaTest以及Scala 2.11版本的最新版本.
解决方案可能是由SBT明确添加一个建议版本.所有警告在以下情况下libraryDependencies
都会消失:
libraryDependencies ++= Seq( "com.typesafe.akka" %% "akka-actor" % "2.4.1", "org.scalatest" %% "scalatest" % "2.2.4" % "test", "org.scala-lang" % "scala-reflect" % "2.11.7", "org.scala-lang.modules" %% "scala-xml" % "1.0.4" )
在您的特定情况下,这与ISSUE 1933有关 ,您现在可以忽略它.您还可以显式指定所需依赖项的版本,以消除警告.