Enabling Debug for Gradle Application with Embedded Jetty Server

It’s pretty easy to enable debug for Gradle while running on embedded Jetty server. Just enter the following line in command line and run jetty with Gradle command.

$ export GRADLE_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=9898,server=y,suspend=n"

Now run jetty with command line:

$ gradle jettyRunWar

You will see the following information while running jetty:

Listening for transport dt_socket at address: 9898

Now connect to the debug port 9898 with your IDE. And you are all set.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s