Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exception when trying to upgrade to sbt eclipse 4.0.0

I have been successfully using sbt-eclipse 3.0.0 for some time now. I recently upgraded to Play 2.3.8, and need to upgrade to sbt-eclipse 4.0.0 to avoid this problem. I tried updating project/plugins.sbt, but get this error when running activator eclipse:

java.lang.NoSuchMethodError: com.typesafe.sbteclipse.core.EclipsePlugin$.EclipseKeys()Lcom/typesafe/sbteclipse/core/EclipsePlugin$EclipseKeys$;
    at play.PlayEclipse$class.eclipseCommandSettings(PlayEclipse.scala:93)
    at play.Play$.eclipseCommandSettings(Project.scala:17)
    at play.PlayScala$.projectSettings(Project.scala:72)
    at sbt.Load$$anonfun$autoPluginSettings$1$1.apply(Load.scala:666)
    at sbt.Load$$anonfun$autoPluginSettings$1$1.apply(Load.scala:666)
    .....

I tried referencing 4.0.0 only in my ~/.sbt/0.13/plugins/plugins.sbt, then only in my project/plugins.sbt, but this seemed to make no difference. In fact, I'm able to run 3.0.0 activator eclipse when both references are removed. I have no idea how activator/sbt is finding the 3.0.0 plugin in this case - perhaps my error is due to loading both 3.0.0 and 4.0.0?

Environment:

Play 2.3.8
Activator 1.3.4
Scala 2.10.4

~/.sbt/0.13/plugins/plugins.sbt is empty

project/build.properties:

sbt.version=0.13.8

project/plugins.sbt:

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

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

addSbtPlugin("com.typesafe.sbt" % "sbt-uglify" % "1.0.3")

addSbtPlugin("com.typesafe.sbt" % "sbt-digest" % "1.0.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-uglify" % "1.0.3")

addSbtPlugin("com.typesafe.sbt" % "sbt-gzip" % "1.0.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-rjs" % "1.0.6")

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")

resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
like image 844
Adam Rabung Avatar asked Jun 29 '15 16:06

Adam Rabung


2 Answers

The solution for me was to remove support for eclipse globally or in the project, since play already provides internal support for generating eclipse files. In fact, the 4.0.0 version of sbt-eclipse was the problem.

like image 177
Mikaël Mayer Avatar answered Oct 15 '22 19:10

Mikaël Mayer


Upgrade your version of the play plugin from:

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

to:

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

This will work with eclipse plugin 4.0.0

like image 4
ajp013 Avatar answered Oct 15 '22 19:10

ajp013