Reputation: 198188
I found some articles on the internet and some discussions on google group, but they don't work any more.
How to do it with the latest play2-RC3 ?
Upvotes: 6
Views: 3699
Reputation: 613
Go to Run -> DEBUG -> Edit Configurations
use "Remote" Configuration and set the Port to 9999
Upvotes: 0
Reputation: 4380
Debugging Play 2.x is very easy with IntelliJ IDEA 12.x, here are the steps you have to do:
Step 1. Enable the Play Framework Support plugin and the Play 2.0 Support plugin in File > Settings > Plugins.
The generic plugin usually comes with IntelliJ but make sure it's enabled. The Play 2.0 Support plugin can be downloaded by clicking Install Jetbrains plugin...
. Simply locate and install the plugin from the list, the latest working version for 12.x is v.0.2.49. (it may prompt that a Scala plugin needs to be installed aswell)
Step 2. Create a new Play app if you haven't or use an existing one
Step 3. Create a new Debug configuration: Run > Edit configurations...
You can click the +
icon in the top left corner to add a new configuration. Simply select Play 2 app
from the list and give the configuration a name. The default options should be correct but feel free to change them if necessary. When done, click Apply
and Ok
.
Step 4. Your toolbar should now have a Run icon and a Debug icon enabled.
Simply click the green arrow to run the Play application. This is the equivalent of doing play run
from the commandline (except without the commandline).
To debug, click the green bug, next the the arrow. This is the equivalent of doing play debug
from the commandline.
You will now be able to debug when a breakpoint is encountered.
Notes:
play clean-all
and play package
on the commandline, this should resolve most problems. If there are further problems, also try play idea
from the commandline.A video of these steps can also be found in this video by James Ward (start at around 1:40 min.).
Upvotes: 2
Reputation: 2984
You can start the play server in debug mode from console [docs], and should be able attach a debugger instance from Idea given that you know the port debugger is listening on.
I haven't use Idea so not sure if it is doable or not. It is fairly easy from netbeans. I suspect, it should be similar from Idea.
EDIT: They have also posted this in their customization guide for IDEs.
Upvotes: 3