Debug Gradle plugins with IntelliJ

I was able to debug gradle sources (including plugins) using -Dorg.gradle.debug=true (found on gradle forum):

  1. Stop daemons if any:

    ./gradlew --stop

  2. Run

    ./gradlew <task> --no-daemon -Dorg.gradle.debug=true

  3. Connect remotely to gradle process (port 5005) – if using IntelliJ IDEA, see OP’s image above

It should stop on breakpoints now.


BTW, I have created a separate IntelliJ IDEA project for gradle sources. Since I use gradle wrapper, I have grabbed the sources from

~/.gradle/wrapper/dists/gradle-1.11-all/7qd8qq8te5j4f5q9aaei3gh3lj/gradle-1.11/src

In IDEA I did File->Import Project, then selected the above path, then – “Create project from existing sources”. Hit Next couple of times (made sure I didn’t include any jars from lib/plugins directory, since IDEA would complain that most project files already exist).

I then created a remote debug configuration in that IDEA project and used it for debugging gradle.

Leave a Comment

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