Pergunta

In my plugins.sbt file, I have

scalaVersion := "2.10.0"

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

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

When I try run sbt I get, among other things

[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

Why can't SBT find the plugin? I've also tried addSbtPlugin("play" % "sbt-plugin" % "2.1-RC1") with similar results.

Foi útil?

Solução

The problem was including the scalaVersion setting inside the plugins.sbt file. This causes sbt to search for sbt-plugin_2.10.0_0.12 in the repositories when it should actually search for sbt-plugin_2.9.2_0.12.

I'm not sure about the semantics behind specifying the scalaVersion in the plugins.sbt file, but maybe it's declaring the Scala version that SBT is running on.

Here is a link to the Play 2.1 sbt-plugin files: http://repo.typesafe.com/typesafe/simple/ivy-releases/play/sbt-plugin/scala_2.9.2/sbt_0.12/2.1-RC1/srcs/

Outras dicas

As per the documentation, Add this in your project/plugins.sbt:

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

Change the project/build.properties

sbt.version=0.12.2
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top