How to debug a Gradle build.gradle file (in a debugger, with breakpoints)?

There is the easier way:

just add in your command line -Dorg.gradle.debug=true --no-daemon

For example:
gradle nameOfTask -Dorg.gradle.debug=true --no-daemon

Then you should start your IDE and run remote debugging with localhost port 5005, that all.

Gradle is waiting to you, because standard option server=y

org.gradle.debug

When set to true, Gradle will run the build with remote debugging enabled, listening on port 5005. Note that this is the equivalent of adding -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 to the JVM command line and will suspend the virtual machine until a debugger is attached.

Link to docs

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)