0

Getting this error when running custom task "integTest", tried on both Gradle 2.4 and 3.0. Still fairly new to gradle, could be something obvious.

FAILURE: Build failed with an exception.

What went wrong:

Cannot infer Groovy class path because no Groovy Jar was found on class path: file collection

The integration tests all run fine individually, it's just that I can't run them all because this task does not seem to be getting the right classpath.

Any insight would be appreciated.

Here is the relevant configuration:

sourceSets {
  integTest {
    groovy {
      compileClasspath += main.output + test.output
      runtimeClasspath += main.output + test.output
      srcDir file('src/integTest/groovy')
    }
  resources.srcDir file('src/integTest/resources')
  }
}

task integTest(type: Test) {
  testClassesDir = sourceSets.integTest.output.classesDir
  classpath = sourceSets.integTest.runtimeClasspath
}

UPDATE: Adding dependencies.

dependencies {
    compile "org.codehaus.groovy:groovy-all:2.4.5"
    compile "log4j:log4j:1.2.17"
    compile "org.slf4j:slf4j-simple:1.7.12"
    compile project(':module-loader')
    testCompile "org.spockframework:spock-core:1.0-groovy-2.4"
}
solvingJ
  • 1,130
  • 14
  • 27

1 Answers1

0

I added this to the build.gradle file and it seems to be working now:

configurations {
    integTestCompile.extendsFrom testCompile
    integTestRuntime.extendsFrom testRuntime
}
solvingJ
  • 1,130
  • 14
  • 27