Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can't SBT find the Play 2.1 plugin?

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.

like image 269
Mark Avatar asked Jan 29 '13 00:01

Mark


2 Answers

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/

like image 191
Mark Avatar answered Oct 22 '22 00:10

Mark


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
like image 20
indykish Avatar answered Oct 22 '22 00:10

indykish