5
我有導致執行錯誤的警告:非相干Scala庫版本
[info] Set current project to calculator (in build file:/home/guillaume/projects/scala/2/)
[info] Updating {file:/home/guillaume/projects/scala/2/}root...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[warn] Scala version was updated by one of library dependencies:
[warn] * org.scala-lang:scala-library:2.10.5 -> 2.11.1
[warn] To force scalaVersion, add the following:
[warn] ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) }
[warn] Run 'evicted' to see detailed eviction warnings
[info] Compiling 3 Scala sources to /home/guillaume/projects/scala/2/target/scala-2.10/classes...
[success] Total time: 9 s, completed Apr 5, 2016 12:16:04 AM
這很奇怪,因爲我的斯卡拉版> 2.11:
$ scala -version
Scala code runner version 2.11.8 -- Copyright 2002-2016, LAMP/EPFL
$sbt sbtVesion
[info] 0.13.9
我build.sbt:
lazy val root = (project in file(".")).
settings(
name := "calculator",
libraryDependencies += "jline" % "jline" % "2.12",
libraryDependencies += "com.typesafe.akka" % "akka-actor_2.11" % "2.3.4"
)
我只是不明白爲什麼我的Scala庫已經過時。
謝謝,增加'scalaVersion'解決了我的問題。但是在'libraryDependencies'中添加'%%'會添加另一個警告:'jline#jline_2.11; 2.12:not found '和'com.typesafe.akka#akka-actor_2.11_2.11; 2.3.4:not found'。但是如果沒有'%%'這個程序就完美了! – Moebius
有兩個問題:JLine不是Scala庫,所以你不需要雙'%%'或'_2.11' - 你的原始版本是正確的。對於阿卡,你只需要其中的一個,因爲他們表達了同樣的事情。我會建議'%%'版本。 –
'corss CrossVersion.full'對於需要像'ammonite-repl'這樣完整版本的依賴項非常方便。 –