Does anyone know how to configure the jetty gradle plugin to run in debug mode so that I can attach a remote debugger?
I've tried setting the gradle and java opts to:
-Xdebug -Xrunjdwp:transport=dt_socket,address=9999,server=y,suspend=n
...but it doesn't seem to work.
I'm able to get my own jetty installation working fine, just not via gradle (jettyRun or jettyRunWar).
Regards.
Open Eclipse and go to Run -> Debug Configurations.... Select the Remote Java Application in the list of configuration types on the left. Click the New toolbar button. In the Project field of the Connect tab, type or browse to select the project to use as a reference for the launch (for source lookup).
On Linux:
export GRADLE_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=9999,server=y,suspend=n" gradle jettyRun
On Windows:
set GRADLE_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=9999,server=y,suspend=n gradle jettyRun
Try using Gretty plugin, it provided gradle tasks jettyRunDebug, jettyStartDebug etc.
Source code and doc: https://github.com/akhikhl/gretty
Disclosure: I am author of Gretty plugin.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With