Jay Taylor | programmer notes

Aug/12

20

Scala Diaries: Play Framework 2.0.x, Play SBT Plugin Breakage

Today after I pulled the latest from the Play 2.0 repository and rebuilt the project, the local Play20 repository was wiped out and then my play apps were no longer able to run! SBT and the Play SBT Plugin could no longer be found, or the versions I had were no longer compatible w/ the latest version of Play. Here are some of the errors I was getting:

$ play run
Getting org.scala-sbt sbt 0.11.3 ...

:: problems summary ::
:::: WARNINGS
		module not found: org.scala-sbt#sbt;0.11.3

	==== local: tried

	  /usr/local/Play20/repository/local/org.scala-sbt/sbt/0.11.3/ivys/ivy.xml

	==== Maven2 Local: tried

	  file:///Users/user/.m2/repository/org/scala-sbt/sbt/0.11.3/sbt-0.11.3.pom

	==== typesafe-ivy-releases: tried

http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.11.3/ivys/ivy.xml

	==== Maven Central: tried

http://repo1.maven.org/maven2/org/scala-sbt/sbt/0.11.3/sbt-0.11.3.pom

		::::::::::::::::::::::::::::::::::::::::::::::
		::          UNRESOLVED DEPENDENCIES         ::
		::::::::::::::::::::::::::::::::::::::::::::::
		:: org.scala-sbt#sbt;0.11.3: not found      ::
		::::::::::::::::::::::::::::::::::::::::::::::

:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
unresolved dependency: org.scala-sbt#sbt;0.11.3: not found
Error during sbt execution: Error retrieving required libraries
  (see /usr/local/Play20/framework/sbt/boot/update.log for complete log)
Error: Could not retrieve sbt 0.11.3

which eventually further degraded into..

[warn] 	module not found: play#sbt-plugin;2.1-07132012
[warn] ==== typesafe-ivy-releases: tried
[warn]   http://repo.typesafe.com/typesafe/ivy-releases/play/sbt-plugin/scala_2.9.2/sbt_0.12/2.1-07132012/ivys/ivy.xml
[warn] ==== sbt-plugin-releases: tried
[warn]   http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/play/sbt-plugin/scala_2.9.2/sbt_0.12/2.1-07132012/ivys/ivy.xml
[warn] ==== local: tried
[warn]   /Users/jay/sendhub/api/Play20/repository/local/play/sbt-plugin/scala_2.9.2/sbt_0.12/2.1-07132012/ivys/ivy.xml
[warn] ==== Typesafe repository: tried
[warn]   http://repo.typesafe.com/typesafe/releases/play/sbt-plugin_2.9.2_0.12/2.1-07132012/sbt-plugin-2.1-07132012.pom
[warn] ==== sbt-plugin-releases: tried
[warn]   http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/play/sbt-plugin/scala_2.9.2/sbt_0.12/2.1-07132012/ivys/ivy.xml
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/play/sbt-plugin_2.9.2_0.12/2.1-07132012/sbt-plugin-2.1-07132012.pom
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[warn] 	::          UNRESOLVED DEPENDENCIES         ::
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[warn] 	:: play#sbt-plugin;2.1-07132012: 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-07132012 (sbtVersion=0.12, scalaVersion=2.9.2)
[warn]

Here is the content of the relevant project configuration files:

$ cat project/build.properties
sbt.version=0.11.3
$ cat project/plugins.sbt
// Comment to get more information during initialization
logLevel := Level.Warn

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

// Use the Play sbt plugin for Play projects
addSbtPlugin("play" % "sbt-plugin" % "2.1-07132012")

I dug around and did a little googling to find a more up to date repository for sbt/play.sbt-plugin, and found what seems like a new typesafe repo at http://typesafe.artifactoryonline.com/typesafe/repo. I added it to my project/Build.scala:

    val main = PlayProject(appName, appVersion, appDependencies, mainLang = SCALA).settings(
        resolvers ++= Seq(
            "Sonatype Releases" at "http://oss.sonatype.org/content/repositories/releases",
            "JBoss Repository" at "http://repository.jboss.org/nexus/content/groups/public",
            "CodaHale Repository" at "http://repo.codahale.com",
            "Scala.sh Releases" at "http://scala.sh/repositories/releases",
            "Scala.sh Snapshots" at "http://scala.sh/repositories/snapshots",
            "Maven1" at "http://repo1.maven.org/maven2",
            "Typesafe Artifactory" at "http://typesafe.artifactoryonline.com/typesafe/repo"
        )

I also found a recent question on their discussion forum which helped me solve my problem, where Peter Hausel revealed that the new correct version of the play sbt plugin was “2.1-08072012″.

So I edied project/build.properties to contain:

sbt.version=0.12.0

Then edited probject/plugins.sbt to contain:

// Comment to get more information during initialization
logLevel := Level.Warn

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

// Use the Play sbt plugin for Play projects
addSbtPlugin("play" % "sbt-plugin" % "2.1-08072012")

After doing all this, I am back up and running. Sometimes JVM jar dependencies can be quite the adventure.

Related posts:

  1. Scala Diaries: Programmatically restoring sanity to sour syntax
  2. HOWTO: Make IntelliJ + Scala run fast/smooth on Mac OS-X

RSS Feed

2 Comments for Scala Diaries: Play Framework 2.0.x, Play SBT Plugin Breakage

Author comment by openid.sys.kth.se/paddy | October 1, 2012 at 12:23 am

Nice writeup. A little type “[s]bt.version=0.12.0″ missing s.

Author comment by outtatime | November 8, 2012 at 2:27 pm

Thanks, typo fixed.

Leave a comment!

You must be logged in to post a comment.

<<

>>

Find it!