0
votes

I'm using intellij and have followed this doc:

https:// www.playframework.com/documentation/2.5.x/Migration25

I changed the plugins.sbt like this:

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.3")

Then it gets stuck:

[debug]         tried https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.play/sbt-plugin/scala_2.10/sbt_0.13/2.5.3/ivys/ivy.xml

I checked this repository and there's no 2.5.3 version.

What I'm doing wrong?

This is my build.sbt:

name := "play"

version := "1.0"

lazy val play = (project in file(".")).enablePlugins(PlayJava)

scalaVersion := "2.11.7"

libraryDependencies ++= Seq( javaJdbc, cache, javaWs

)

unmanagedResourceDirectories in Test <+= baseDirectory(_ / "target/web/public/test")

resolvers += "scalaz-bintray" at "https://dl.bintray.com/scalaz/releases"

This is my project/plugins.sbt:

logLevel := Level.Info

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

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.3")

Another problem: When i change to 2.4.6, it works, but there's another problem,project refresh failed

java.lang.UnsupportedClassVersionError: com/typesafe/config/ConfigException : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at com.typesafe.sbt.web.SbtWeb$$anonfun$com$typesafe$sbt$web$SbtWeb$$load$1.apply(SbtWeb.scala:535)
at com.typesafe.sbt.web.SbtWeb$$anonfun$com$typesafe$sbt$web$SbtWeb$$load$1.apply(SbtWeb.scala:535)
at scala.Option.fold(Option.scala:157)

My JDK is 1.8

2
Please, edit the question to add build.sbt file and also project/plugins.sbt. Probably there is a resolver missing. You can also post the result of executing sbt resolvers.marcospereira

2 Answers

0
votes

The error somehow showing that there is a misspelling in play version like you added, try the following plugins.sbt (this is my sbt that working good for me) remove the plugins that you don't want and add what you are using but becarful for the versions that you use:

// The Play plugin
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.3")

// Web plugins
addSbtPlugin("com.typesafe.sbt" % "sbt-coffeescript" % "1.0.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.1.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-jshint" % "1.0.3")
addSbtPlugin("com.typesafe.sbt" % "sbt-rjs" % "1.0.7")
addSbtPlugin("com.typesafe.sbt" % "sbt-digest" % "1.1.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-mocha" % "1.1.0")
addSbtPlugin("org.irundaia.sbt" % "sbt-sassify" % "1.4.2")

// Play enhancer - this automatically generates getters/setters for public fields
// and rewrites accessors of these fields to use the getters/setters. Remove this
// plugin if you prefer not to have this feature, or disable on a per project
// basis using disablePlugins(PlayEnhancer) in your build.sbt
addSbtPlugin("com.typesafe.sbt" % "sbt-play-enhancer" % "1.1.0")

// Play Ebean support, to enable, uncomment this line, and enable in your build.sbt using
// enablePlugins(PlayEbean). Note, uncommenting this line will automatically bring in
// Play enhancer, regardless of whether the line above is commented out or not.
addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "3.0.1")


// Not necessary but useful for development
// https://github.com/jamesward/play-auto-refresh
//addSbtPlugin("com.jamesward" % "play-auto-refresh" % "0.0.14")

You can verify version from : http://mvnrepository.com/artifact/com.typesafe.play

since you use 2.5.x verify the versions under 2_11 not 2_10, like play_2.11 not play_2.10 , so check your plugins that using scala 2.11 not 2.10 this what maybe made 2.4.3 works and not 2.5.x .

0
votes

First, make sure your sbt version is up to date; project/build.properties should contain:

sbt.version=0.13.11

As the latest sbt version includes some new resolvers; you just have to put the play plugin in project/plugins.sbt:

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.3")