9

On Github there is an description how to build the framework from scratch. How ever I want to understand how somethings work internally so I want to setup the Eclipse-IDE to make this as comfortable as possible. Has anyone a description how this can be easily done?

To make it clear, I don't want to know how to setup eclipse for working on play-project.

3 Answers 3

6

THIS SOLUTION WAS FOR PLAY 2.0, you can't use it directly in 2.1! at least the command build-repository isn't valid anymore.

git clone git://github.com/playframework/Play20.git

Add

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

to play20/framework/project/plugins.sbt, so you get

logLevel := Level.Warn

resolvers += Classpaths.typesafeResolver

addSbtPlugin("com.typesafe.sbtscalariform" % "sbtscalariform" % "0.3.0")

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

Then make the normal build processes.

$ cd Play20/framework
$ ./build
> build-repository
> eclipse

Create a Scala-IDE give her enough Space, choose the 64-bit variant if you can!

Import projects from play20/framework/src

Add /Play/target/scala-2.9.1/src_managed/main as source folder.

You will end up with less than 10 compilation errors :-(, but will have the most of the code in eclipse.

4
  • I managed to build successfully, and have just a single error in Eclipse/Scala-IDE (sbt run/compile is fine). Unfortunately, the error ("value setPrefix is not a member of play.core.Router.Routes") breaks some Scala-IDE functionality, which is highly annoying! arggghhh ;-) Do you have an error-free IDE setup? Commented May 27, 2012 at 9:09
  • I guess "~ run", or "~ compile" is the only way to know the true state of one's app in 2.1-snapshot, too bad Commented May 27, 2012 at 20:13
  • see my answer below, hope it helps Commented May 31, 2012 at 22:44
  • > build-repository is not a valid command anymore, other than that it worked like charm. Thanks! Commented Aug 9, 2013 at 4:14
1

When building against 2.1 snapshot, Eclipse keeps the .ivy2/cache jar of play 2.0.1, which is where, in my case the errors were coming from.

The solution is to remove play 2.0.1 jar from eclipse build path, and add in the 2.1 snapshot jar that you build (in your-play20/repository/local/play/play_2.9.1/2.1-SNAPSHOT/jars)

Got an error free Eclipse + Scala-IDE setup, nice ;-)

3
  • I've had multiple errors due to older versions of libraries residing in .ivy2 too, so this answer must also be taken into account.
    – Herrmann
    Commented May 1, 2013 at 22:22
  • I tried building play 2.1.1, and got most things working, however I got 22 errors: sbinary_2.9.0-0.4.0.jar is cross-compiled with an incompatible version of Scala (2.9.0). In case of errorneous report, this check can be disabled in the compiler preference page. I am assuming this has to do with either the version of Scala-IDE I am using, or the version of the sbt-eclipse plugin. Any ideas?
    – noplay
    Commented May 16, 2013 at 15:54
  • play 2.1 should be built against scala 2.10; give latest Scala IDE (v3) a shot; then do an eclipse from play> commandline to generate play aware eclipse project to import into Eclipse. Finally, you can try to build sbinary yourself (if source is available) via publish-local, perhaps with a "notTransitive" flag to prevent pulling down any 2.9 based dependencies. Good luck ;-) Commented May 16, 2013 at 16:39
0

Take a look at the Sbt eclipse Plugin. It will generate an eclipse project for you. It should be rather easy. Just follow the instruction on the plugins git page. Regards. Jan

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.