1
votes

I have split Scala/SBT project into several sub-projects. One of the subprojects is Play Framework web application.

After this change I'm struggling to start the application in debug mode. I am able to run it in the following way:

$ projects
[info] In file:/my/project/
[info]   * root
[info]     actors
[info]     test
[info]     ui
$ project ui
$ projects
[info] In file:/my/project/
[info]     root
[info]     actors
[info]     test
[info]   * ui
$ run

This doesn't open JPDA port for debugging though. What is the way to start a subproject in debug mode?

1
How did you "start the application in debug mode" before? You can run the ui project with ui/run. Read Scope axes. - Jacek Laskowski
When having everything in a single module I was able to run play debug. Thank you for the hinting me with the scope axes, it looks like the solution I was looking for. - Bartosz Jankiewicz
Let me know how change the answer so...hint, hint...it gets approved :) We could also work out the question better so it fits your needs. - Jacek Laskowski
Ah, play debug. You should be able to do ui/debug. - Jacek Laskowski
I have tried that and I'm getting the following errors: play ui/run java.lang.RuntimeException: */*:playRunHooks is undefined. at scala.sys.package$.error(package.scala:27) [trace] Stack trace suppressed: run last ui/compile:run for the full output. [error] (ui/compile:run) */*:playRunHooks is undefined. [error] Total time: 92 s, completed May 14, 2014 6:51:54 PM - Bartosz Jankiewicz

1 Answers

0
votes

There's the section Debugging in the official Play documentation that says:

You can ask Play to start a JPDA debug port when starting the console. Use the activator -jvm-debug <port> command to do that:

$ activator -jvm-debug 9999

With the port open, you should be able to attach to 9999 port and debug away.

In the older version of Play 2.2, there was play debug command that you could use in your case, just scope it to ui project.

play ui/debug

That should give you what you're after.