문제

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?

도움이 되었습니까?

해결책

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

다른 팁

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:

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top