Bartłomiej Szałach
Bartłomiej Szałach

Reputation: 2453

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.

Upvotes: 4

Views: 5012

Answers (3)

mCs
mCs

Reputation: 2911

The problem is fixed with sbt 0.13.12

Upvotes: 1

Bartłomiej Szałach
Bartłomiej Szałach

Reputation: 2453

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

Upvotes: 11

YoK
YoK

Reputation: 1636

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.

Upvotes: 6

Related Questions