8

I have set up my pom.xml like so, and it appears to be working for the most part, I can start the devserver and update the application.

My problem is that I can't seem to debug the devserver. I tried launching the devserver maven goal in debug mode from within IDEA, but when I set breakpoints they are ignored.

I found in the GAE Maven plugin docs that you can launch the devserver in debug mode with the following configuration:

<jvmFlags>
  <jvmFlag>-Xdebug</jvmFlag>
  <jvmFlag>-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n</jvmFlag>
</jvmFlags>

However I don't know how to tell IDEA to connect the debugger when I start the Maven Run/Debug configuration.

Can anyone point me in the right direction?

sanity
  • 35,347
  • 40
  • 135
  • 226

1 Answers1

15

The configuration mentioned in your question looks good. So, you have:

<jvmFlags>
  <jvmFlag>-Xdebug</jvmFlag>
  <jvmFlag>-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n</jvmFlag>
</jvmFlags>
  1. When you run your Maven build

    mvn appengine:devserver
    

    at some point it halts and waits for the remote debugger to connect.

  2. In IDEA, go to Run > Edit Configurations... and add a new Remote configuration.

  3. Give it a name and check parameters (especially the port).enter image description here
  4. Click OK
  5. Run the debugger with Run > Debug '<name of your config>' (Shift-F9)
Moritz Petersen
  • 12,902
  • 3
  • 38
  • 45
  • Oh, it's not particularly important, but are you aware of a way to consolidate both run configs into a single run config? – sanity Sep 09 '13 at 21:42
  • 1
    You can also add the goals appengine:deserver_stop & appengine:devserver_start before attaching the debugger. This will automatically run the server and you'll be able to debug. – bentzy Mar 02 '14 at 14:52