9

私の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がプラグインを見つけられないのはなぜですか?私もaddSbtPlugin("play" % "sbt-plugin" % "2.1-RC1")同様の結果を試しました。

4

2 に答える 2

5

問題は、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-plugin ファイルへのリンク: http://repo.typesafe.com/typesafe/simple/ivy-releases/play/sbt-plugin/scala_2.9.2/sbt_0.12/2.1-RC1/srcs /

于 2013-01-29T02:33:45.170 に答える
1

ドキュメントに従って、これをに追加しますproject/plugins.sbt

addSbtPlugin("play" % "sbt-plugin" % "2.1.0")

変更project/build.properties

sbt.version=0.12.2
于 2013-02-06T13:37:09.767 に答える