Skip to content
Scott Kurz edited this page Mar 16, 2023 · 3 revisions

Debugging from Eclipse

Try the Groovy Development Tools (GDT) feature: https://marketplace.eclipse.org/content/groovy-development-tools

NOTE: I had trouble installing into Eclipse 2022-12, but it worked fine installing GDT Version: 4.8.0.v202212311458-e2209-RELEASE into Eclipse for Java 2022-09.

Debugging dev mode (requires Gradle 7.4+)

(Based on looking at different doc versions the org.gradle.debug.port property this relies on seems to have been added in Gradle 7.4)

In general Gradle debug is done by running with gradle -Dorg.gradle.debug=true which launches a daemon in suspended mode, waiting for a debugger attachment (or, if an unused daemon exists it connects to it) on port 5005.

Dev mode is special because it launches a child Gradle build which would potentially need a daemon on the same port, which would be a problem since this daemon is already in use for the parent build task.

Recently, (in a fix going into v3.5.3), we added support to launch the child gradle build on a separate debug port (in the case the parent gradle build is launched with -Dorg.gradle.debug=true). This will default to port 6006 (kinda like 5005), but will use the ci.common findAvailablePort function if that port isn't available. The child debug port will be cached, so each child task should typically be able to reuse this same daemon on the same debug port, since this daemon will free up each time dev mode launches a child gradle.

Clone this wiki locally