How to debug play2 in the idea?

I found some articles on the Internet and some discussions in the google group, but they no longer work.

How to do this with the latest play2-RC3?

+6
source share
3 answers

You can start the game server in debug mode from the [docs] console and should be able to attach an Idea debugger instance, given that you know that the port listener is listening.

I do not use Idea, so I'm not sure if this is workable or not. This is pretty easy on netbeans. I suspect it should be like an Idea.

EDIT: They also posted this in their setup guide for the IDE.

+3
source

Debugging Play 2.x is very easy in IntelliJ IDEA 12.x, here are the steps you should follow:

Step 1. Enable the Play Framework Support Plugin and Play 2.0 Support Plugin in the File> Preferences> Plugins menu.

repo image

The general plugin usually comes with IntelliJ, but make sure it is enabled. Play 2.0 Support Plugin can be downloaded by clicking Install Jetbrains plugin... Just find and install the plugin from the list, the latest working version for 12.x is v.0.2.49 . (he may suggest that you need to install the Scala plugin)

Step 2. Create a new Play application if you don’t have one or use an existing one

Step 3. Create a new debug configuration: Run> Change Configurations ...

You can click the + icon in the upper left corner to add a new configuration. Just select the Play 2 app from the list and specify the name configuration. The default settings must be correct, but you can change them if necessary. When done, click Apply and Ok .

Step 4. Your toolbar should now have a Run icon and a Debug icon.

play run / debug icon

Just click the green arrow to launch the Play app. This is equivalent to executing a play run from the command line (except without a command line).
To debug, click the green error, then the arrow. This is equivalent to executing a play debug from the command line.

Now you can debug when a breakpoint is encountered.

Notes:

  • Make sure that only one configuration is performed at a time, because Play does not like to run multiple instances at the same time.
  • If you have problems compiling, run play clean-all and play package on the command line, this should solve most problems. If there are additional problems, try play idea from the command line.
  • Make sure that the playback configuration is loaded in the settings. You can do this by choosing File> Preferences> Playback Configuration.

A video of these steps can also be found in this video by James Ward (beginning at about 1:40 min.).

+2
source

Go to Run β†’ DEBUG β†’ Change Configurations

use the "Remote" configuration and set the port value to 9999

0
source

Source: https://habr.com/ru/post/909050/


All Articles