How to find out which dependency includes wrong version of Play/Scala in sbt
I am trying to upgrade my Play application from Scala 2.10 to 2.11 and I get conflicting cross-version suffixes:
[info] Done updating.
[error] Modules were resolved with conflicting cross-version suffixes in {file:/E:/Work/MyProject/development/}root:
[error] com.typesafe.akka:akka-actor _2.11, _2.10
[error] com.typesafe.akka:akka-slf4j _2.11, _2.10
[error] org.scala-stm:scala-stm _2.11, _2.10.0
My build.sbt:
name := """My Project"""
version := "1.0-SNAPSHOT"
lazy val root = (project in file(".")).enablePlugins(PlayScala)
resolvers += "Local Maven Repository" at Path.userHome.asFile.toURI.toURL + ".m2/repository"
resolvers += "scala-sbt.org" at "http://repo.scala-sbt.org/scalasbt/repo"
resolvers += "scala-sbt.org 2" at "http://repo.scala-sbt.org/scalasbt/libs-releases"
resolvers += "scala-sbt.org 3" at "http://repo.scala-sbt.org/scalasbt/plugins-releases"
scalaVersion := "2.11.8"
EclipseKeys.withSource := true
libraryDependencies ++= Seq(
jdbc,
anorm,
cache,
ws,
"com.typesafe.akka" %% "akka-contrib" % "2.3.4",
"com.typesafe.akka" %% "akka-actor" % "2.3.4",
"com.typesafe.akka" %% "akka-slf4j" % "2.3.4",
"com.typesafe.akka" %% "akka-testkit" % "2.3.4" % "test",
"io.argonaut" %% "argonaut" % "6.1",
"org.scalaj" %% "scalaj-http" % "2.3.0",
"my.other.project" % "java-artifact" % "2.2.5")
In the log from sbt compile
all of a sudden play_2.10 is resolved:
...
[info] Resolving org.apache.httpcomponents#httpmime;4.0.1 ...
[info] Resolving org.apache.james#apache-mime4j;0.6 ...
[info] Resolving play#play_2.10;2.1.5 ...
[info] Resolving play#sbt-link;2.1.5 ...
[info] Resolving play#play-exceptions;2.1.5 ...
[info] Resolving play#templates_2.10;2.1.5 ...
...
I am using sbt 0.13.5.
I have had this problem before and solving it was a tiresome process. Is there any way to know which of my dependencies includes play_2.10? Can I get a dependency tree or something similar from sbt?
在sbt中没有本地方式,但我有与第三方的良好体验,特别是https://github.com/jrudolph/sbt-dependency-graph。
链接地址: http://www.djcxy.com/p/95144.html