我所指的项目有build.sbt
个文件:
name := "esc-index"
version := "1.0"
scalaVersion := "2.11.7"
resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/repo/"
libraryDependencies ++= {
Seq(
"com.typesafe.play" %% "play" % "2.3.10",
"com.novocode" % "junit-interface" % "0.8" % "test"
)
}
在执行sbt compile时,我收到以下错误。
$ sbt compile
[info] Loading project definition from C:\Users\AnandKrishnan\Documents\GitHub\esc\index\project
[info] Set current project to esc-index (in build file:/C:/Users/AnandKrishnan/Documents/GitHub/esc/index/)
[info] Updating {file:/C:/Users/AnandKrishnan/Documents/GitHub/esc/index/}index...
[info] Resolving jline#jline;2.12.1 ...
[info] Done updating.
[error] Modules were resolved with conflicting cross-version suffixes in {file:/C:/Users/AnandKrishnan/Documents/GitHub/esc/index/}index:
[error] com.typesafe.akka:akka-actor <none>, _2.11
java.lang.RuntimeException: Conflicting cross-version suffixes in: com.typesafe.akka:akka-actor
at scala.sys.package$.error(package.scala:27)
at sbt.ConflictWarning$.processCrossVersioned(ConflictWarning.scala:46)
at sbt.ConflictWarning$.apply(ConflictWarning.scala:32)
at sbt.Classpaths$$anonfun$66.apply(Defaults.scala:1164)
at sbt.Classpaths$$anonfun$66.apply(Defaults.scala:1161)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
at sbt.std.Transform$$anon$4.work(System.scala:63)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.Execute.work(Execute.scala:235)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
[error] (*:update) Conflicting cross-version suffixes in: com.typesafe.akka:akka-actor
[error] Total time: 3 s, completed Jan 4, 2016 8:48:19 AM
我在sbt clean
之前做过sbt compile
。我也尝试过像这样.exclude("com.typesafe.akka", "akka-actor_2.11")
排除akka而没有运气。
答案 0 :(得分:1)
我刚刚从新目录/tmp/aaa
成功尝试:
$ cat > build.sbt
name := "esc-index"
version := "1.0"
scalaVersion := "2.11.7"
resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/repo/"
libraryDependencies ++= {
Seq(
"com.typesafe.play" %% "play" % "2.3.10",
"com.novocode" % "junit-interface" % "0.8" % "test"
)
}
$ sbt
[info] Loading global plugins from /Users/filippovitale/.sbt/0.13/plugins
[info] Updating {file:/Users/filippovitale/.sbt/0.13/plugins/}global-plugins...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Set current project to esc-index (in build file:/private/tmp/aaa/)
> compile
[info] Updating {file:/private/tmp/aaa/}aaa...
[info] Resolving jline#jline;2.12.1 ...
[info] downloading https://jcenter.bintray.com/com/typesafe/play/play_2.11/2.3.10/play_2.11-2.3.10.jar ...
[info] [SUCCESSFUL ] com.typesafe.play#play_2.11;2.3.10!play_2.11.jar (5094ms)
[info] downloading https://jcenter.bintray.com/com/typesafe/play/build-link/2.3.10/build-link-2.3.10.jar ...
[info] [SUCCESSFUL ] com.typesafe.play#build-link;2.3.10!build-link.jar (908ms)
[info] downloading https://jcenter.bintray.com/com/typesafe/play/play-iteratees_2.11/2.3.10/play-iteratees_2.11-2.3.10.jar ...
[info] [SUCCESSFUL ] com.typesafe.play#play-iteratees_2.11;2.3.10!play-iteratees_2.11.jar (2011ms)
[info] downloading https://jcenter.bintray.com/com/typesafe/play/play-json_2.11/2.3.10/play-json_2.11-2.3.10.jar ...
[info] [SUCCESSFUL ] com.typesafe.play#play-json_2.11;2.3.10!play-json_2.11.jar (1872ms)
[info] downloading https://jcenter.bintray.com/io/netty/netty/3.9.9.Final/netty-3.9.9.Final.jar ...
[info] [SUCCESSFUL ] io.netty#netty;3.9.9.Final!netty.jar(bundle) (2119ms)
[info] downloading https://jcenter.bintray.com/com/typesafe/play/play-exceptions/2.3.10/play-exceptions-2.3.10.jar ...
[info] [SUCCESSFUL ] com.typesafe.play#play-exceptions;2.3.10!play-exceptions.jar (842ms)
[info] downloading https://jcenter.bintray.com/com/typesafe/play/play-functional_2.11/2.3.10/play-functional_2.11-2.3.10.jar ...
[info] [SUCCESSFUL ] com.typesafe.play#play-functional_2.11;2.3.10!play-functional_2.11.jar (1927ms)
[info] downloading https://jcenter.bintray.com/com/typesafe/play/play-datacommons_2.11/2.3.10/play-datacommons_2.11-2.3.10.jar ...
[info] [SUCCESSFUL ] com.typesafe.play#play-datacommons_2.11;2.3.10!play-datacommons_2.11.jar (850ms)
[info] downloading https://jcenter.bintray.com/com/novocode/junit-interface/0.8/junit-interface-0.8.jar ...
[info] [SUCCESSFUL ] com.novocode#junit-interface;0.8!junit-interface.jar (1066ms)
[info] downloading https://jcenter.bintray.com/junit/junit/4.8.2/junit-4.8.2.jar ...
[info] [SUCCESSFUL ] junit#junit;4.8.2!junit.jar (1795ms)
[info] Done updating.
[success] Total time: 33 s, completed 04/01/2016 2:31:04 PM