Sbt 如何将库依赖项更新到Scala版本?

Sbt 如何将库依赖项更新到Scala版本?,sbt,Sbt,我正在用sbt编译我的项目,并且得到了一个未解决的依赖项错误 事实上,我从一个在线博客中获取了我使用的示例(hello world程序),该示例使用了scalaVersion:=“2.10.0”,如下所示。我使用的是2.11.2 如何将库依赖项(在build.sbt中)更新为Scala的最新版本,特别是修订版部分 构建.sbt name := "Hello Test #1" version := "1.0" scalaVersion := "2.10.0" resolvers += "Ty

我正在用sbt编译我的项目,并且得到了一个
未解决的依赖项
错误

事实上,我从一个在线博客中获取了我使用的示例(hello world程序),该示例使用了
scalaVersion:=“2.10.0”
,如下所示。我使用的是2.11.2

如何将库依赖项(在
build.sbt
中)更新为Scala的最新版本,特别是
修订版
部分

构建.sbt

name := "Hello Test #1"

version := "1.0"

scalaVersion := "2.10.0"

resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/"

libraryDependencies += "com.typesafe.akka" % "akka-actor_2.10" % "2.2-M1"
错误:

[info] Resolving com.typesafe.akka#akka-actor_2.11.2;2.2-M1 ...
[warn]  module not found: com.typesafe.akka#akka-actor_2.11.2;2.2-M1
[warn] ==== local: tried
[warn]   /home/plard/.ivy2/local/com.typesafe.akka/akka-actor_2.11.2/2.2-M1/ivys/ivy.xml
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/com/typesafe/akka/akka-actor_2.11.2/2.2-M1/akka-actor_2.11.2-2.2-M1.pom
[warn] ==== Typesafe Repository: tried
[warn]   http://repo.typesafe.com/typesafe/releases/com/typesafe/akka/akka-actor_2.11.2/2.2-M1/akka-actor_2.11.2-2.2-M1.pom
[info] Resolving jline#jline;2.12 ...
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.typesafe.akka#akka-actor_2.11.2;2.2-M1: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[trace] Stack trace suppressed: run last *:update for the full output.
[error] (*:update) sbt.ResolveException: unresolved dependency: com.typesafe.akka#akka-actor_2.11.2;2.2-M1: not found
[error] Total time: 1 s, completed Aug 11, 2014 10:32:11 AM

这应该可以做到。请注意,
%%
并且没有为Akka工件指定版本。这样,SBT会自动将您的Scala版本附加到工件上。有关更多详细信息,请参阅。

此语法是否适用于我要添加到项目中的任何依赖项?也就是说:“%$name”%%“reversion””函数是吗?@wipman是的,只要依赖项工件遵循“name_x.x”约定
name := "Hello Test #1"

version := "1.0"

scalaVersion := "2.11.2"

resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/"

libraryDependencies += "com.typesafe.akka" %% "akka-actor" % "2.3.4"