Question

Play 2.0 uses SBT. However it provides its own SBT action, idea, to create a module for a new project. You have to create an IDEA project yourself and add the module to it. Fine.

What's not fine is that Play 2.0 is used from its source directory when it's unpacked, and there is a repository/ subdirectory which is in fact an ivy repository, separate from your ~/.ivy2.

How do you configure an SBT build for the app? In the imported libraries, IDEA cannot recognize the Scala compiler.

Play sources are not in the repository/. When I do publish-local building Play 2.0 from git, it deposits the jar, currently at 2.0-RC3-SNAPSHOT, there, but not sources. Running SBT action package-src does produce the source jar, but it seems left in place. Attaching it from IDEA still doesn't show source of FakeRequest.

Would it be preferable to rely on the gen-idea in SBT instead of idea?

Was it helpful?

Solution

Since play has been released in final the idea command has been significantly improved.

You can also call it like this

idea with-sources

And it will download all docs and sources and configure them correctly.

You can also connect to plays debugger by starting play with

Play debug

And then choose remote debugging in idea and select port 9999

OTHER TIPS

I tried this command and it works fine:

play idea with-sources=yes

With Play 2.0.1 idea with-sources unfortunately does not work:

$ idea with-sources
[error] Expected end of input.
[error] idea with-sources
[error]     ^

I am using following workaround:

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top