How to debug the AppEngine local server from IDEA+Gradle?

First you have to set the JVM debug parameters in your build.gradle file so that you are able to debug the local development server remotely.

appengine {
    ...
    jvmFlags = ['-Xdebug', '-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000']
}

Then you need to create a run/debug configuration in IntelliJ IDEA (based on the above parameters) to be used for remote running or debugging processes. Remote running/debugging enables you to connect to a running JVM.

You can find more details here. But basically go to the Run / Edit Configurations..., in the dialog box click on Add New Configuration (+) and select Remote. Make sure that the configuration matches JVM flags (especially port). Save and close the dialog box.

Start your local development server and connect debugger (Run / Debug).