如何在sbt中找出哪个依赖项包含错误版本的Play / Scala

时间:2016-09-23 12:59:12

标签: scala playframework playframework-2.0 sbt

我正在尝试将我的Pl​​ay应用程序从Scala 2.10升级到2.11,并且我遇到了冲突的跨版本后缀:

[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

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

在来自sbt compile的日志中突然播放了play_2.10:

...     
[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 ...
...

我正在使用sbt 0.13.5。

之前我遇到过这个问题并且解决它是一个令人厌烦的过程。 有没有办法知道哪些依赖项包含play_2.10? 我可以从sbt获得依赖树或类似的东西吗?

1 个答案:

答案 0 :(得分:0)

在某些方面没有本土方式,但我在第三方方面有很好的经验,特别是https://github.com/jrudolph/sbt-dependency-graph