Debugging a jetty app running from gradle

I have an app running in jetty via gradle jettyRun, and I can't figure out how to attach the debugger to it. I have tried starting gradle with the following options

export GRADLE_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=52252,suspend=n,server=y -javaagent:/opt/idea-IU-133.1122/plugins/Groovy/lib/agent/gragent.jar"
gradle jettyRun

And then creating a remote jetty server configuration in intellij, but I just get a message saying I could not connect to the server. Since gradle uses an embedded jetty server, I had to point to a downloaded version of jetty that's running the same version (and older version of jetty 6).

I can attach fine to Tomcat, so there's an issue here with jetty - any thoughts on how to attach the IntelliJ debugger to a gradle jettyRun app?

1 comment

Answered my own question. Turned out to be quite tricky, but I posted on how to do it here.


Please sign in to leave a comment.