Tests do not run when using custom configuration


I’ve been using custom configuration to emulate Maven’s “provided” so that the users of my library (a plugin for Spock, actually) are free to use the version of Groovy and Spock that they prefer (I’d had complaints before).

It works like this…

I add a custom configuration called “provided”:

configurations {
sourceSets {
    main {
        compileClasspath += configurations.provided
    test {
        compileClasspath += configurations.provided

Then, instead of declaring dependencies with “compile”, I declare them with “provided”:

dependencies {
    provided "org.codehaus.groovy:groovy-all:${groovyVersion}"
    provided "org.spockframework:spock-core:${spockVersion}"

   testCompile "cglib:cglib-nodep:2.2.2"

This worked fine in previous versions of Gradle, but when I upgraded to the latest (2.4), the test plugin does not seem to see any test sources.

Is there any way I can make the test plugin “see” my tests?

PS. if you know of a better way to make my dependencies “provided” I would like to know about it!