I don't know how to convert comment into answer, but essentially, @m-ricciuti is correct, what has to be done is:
- add
implementation(gradleApi())
(it's in Kotlin DSL) to dependencies
- specify
-all
distribution in gradle-wrapper.properties
:
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-all.zip
- create "Remote JVM Debug" run configuration in IntelliJ (all settings can be left "as is")
- run gradle with arguments
gradlew <task> -Dorg.gradle.debug=true --no-daemon
, it will say "Starting daemon" and pause
- start the created run configuration via Debug button
This way, you can set breakpoints on @TaskAction
methods, and a lot more, however, I still was not capable to set a breakpoint in a CloseableHttpClient
or an InternalHttpClient
classes. Which is essentially what I was most interested in, so if anyone knows more... please chime in!