Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does sbt give multiple dependencies warning with Akka and ScalaTest dependencies?

I've just added ScalaTest to build.sbt so it now looks as follows:

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

After that I am receiving the warning message:

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)

I also tried changing the line concerning ScalaTest into:

"org.scalatest" %% "scalatest" % "2.2.4" % "test"

but the warning still remains the same as above.

How could I deal with this issue since I haven't anywhere written "reflect" or "xml" in my project. I am using the newest version of both Akka and ScalaTest and Scala version 2.11.

like image 210
Bartłomiej Szałach Avatar asked Dec 01 '22 13:12

Bartłomiej Szałach


2 Answers

The solution might be to add explicitly one of proposed versions by SBT. All warnings pass away when libraryDependencies is:

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"
)
like image 124
Bartłomiej Szałach Avatar answered Dec 04 '22 03:12

Bartłomiej Szałach


In your particular case this is related to the ISSUE 1933 and you can ignore it for now. You can also explicitly specify version of the dependency you need, to silence warnings.

like image 29
YoK Avatar answered Dec 04 '22 02:12

YoK