Sbt 为什么可以';找不到Play 2.1插件?

Sbt 为什么可以';找不到Play 2.1插件?,sbt,playframework-2.1,Sbt,Playframework 2.1,在我的plugins.sbt文件中,我有 scalaVersion := "2.10.0" resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/" addSbtPlugin("play" % "sbt-plugin" % "2.1") 当我尝试运行sbt时,我得到了 [warn] ==== Typesafe repository: tried [warn] http://

在我的
plugins.sbt
文件中,我有

scalaVersion := "2.10.0"

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

addSbtPlugin("play" % "sbt-plugin" % "2.1")  
当我尝试运行
sbt
时,我得到了

[warn] ==== Typesafe repository: tried
[warn]   http://repo.typesafe.com/typesafe/releases/play/sbt-plugin_2.10_0.12/2.1/sbt-        plugin-2.1.pom
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/play/sbt-plugin_2.10_0.12/2.1/sbt-plugin-2.1.pom
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: play#sbt-plugin;2.1: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn]  Note: Some unresolved dependencies have extra attributes.  Check that these         dependencies exist with the requested attributes.
[warn]          play:sbt-plugin:2.1 (sbtVersion=0.12, scalaVersion=2.10)
[warn]
sbt.ResolveException: unresolved dependency: play#sbt-plugin;2.1: not found

为什么SBT找不到插件?我也尝试过添加SbtPlugin(“播放“%”sbt plugin“%”2.1-RC1”),结果类似。

问题在于plugins.sbt文件中包含了scalaVersion设置。这会导致sbt在实际搜索sbt-plugin_2.9.2_0.12时,在存储库中搜索sbt-plugin_2.10.0_0.12

我不确定在plugins.sbt文件中指定scalaVersion背后的语义,但可能它声明了sbt运行的Scala版本

这里是Play 2.1 sbt插件文件的链接:

根据文档, 将此添加到您的
项目/plugins.sbt

addSbtPlugin("play" % "sbt-plugin" % "2.1.0")
更改
project/build.properties

sbt.version=0.12.2