转自:http://codebrickie.com/blog/2011/05/17/start-jetty-in-debug-mode-with-gradle/
You can add the Jetty plugin to your gradle build file. Then you are able to start Jetty with your application by running gradle jettyRun.
If you want to be able to debug your application remotely, just set your GRADLE_OPTS to GRADLE_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=9999,server=y,suspend=n" before starting Jetty.
Jetty will then listen on the specified port for incoming remote debugging connections.
Command could like this :
gradlew jR -Dorg.gradle.jvmargs="-Xdebug -Xrunjdwp:transport=dt_socket,address=9999,server=y,suspend=n"