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

后端 未结 2 823
小鲜肉
小鲜肉 2021-02-15 18:46

I\'m following the Udacity App Engine course but as the tinker, I\'m following using Gradle and IDEA (Open Source edition).

I have setup the project successfully using t

相关标签:
2条回答
  • 2021-02-15 19:05

    Configuration

    Put jvmFlags on build.gradle

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

    Debug

    • On Gradle execute appengineRun and wait to server start
      • Select Run \ Attach to process... to attach to the server and debug
    0 讨论(0)
  • 2021-02-15 19:12

    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).

    0 讨论(0)
提交回复
热议问题