I've launched a test with the --no-daemon parameter but the daemon is launched anyway

I’m trying to debug some unit tests I’ve written but the gradle daemon seems to always launch, ignoring any options I’ve set.

Mac OS X 10.9.5 Java 1.7 Gradle 2.2.1

Launching gradle with: ./gradlew test --no-daemon -Dorg.gradle.debug=true causes the following line to appear To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: http://gradle.org/docs/2.2.1/userguide/gradle_daemon.html.

If I add -d, it turns out that the daemon has launched and is waiting on port 5005 for a debugger: http://pastebin.com/TqaXubmr

Finally, if I then launch a debugger attaching to port 5005 the tests run but none of the breakpoints are hit.

The gradle.properties is empty, I don’t set GRADLE_OPTS or org.gradle.jvmargs.

‘Test’ task forks a jvm before running the tests. Instead of connecting to the test jvm you connecting a debugger to the deamon and that’s why your breakpoints did not work. To be able to attach a debugger to the test jvm simply remove ‘-Dorg.gradle.debug’ from the command line and set the ‘debug’ property of your test task to true in the build script:

test {

debug = true

}