Closed vryzhuk closed 4 years ago
Additional test runtime classpath becomes not visible during test execution when plugin test-sets applied. Test fails with NoClassDefFoundError.
test-sets
How to reproduce:
Create two source sets in build.gradle:
sourceSets { testData { java { srcDir 'src/testData/java' compileClasspath += sourceSets.main.runtimeClasspath } } test { java { compileClasspath += sourceSets.testData.output runtimeClasspath += sourceSets.testData.output } } }
Create some class in testData and create Test, which has reference to it.
Run gradle build - SUCCESS
Add test-sets plugin
plugins { id 'org.unbroken-dome.test-sets' }
Run gradle build - crashed during test execution phase with "> initializationError FAILED java.lang.NoClassDefFoundError: < class from testData >"
More investigations:
build/classes/java/testData
Workaround: specify dependency to testData in dependencies section:
dependencies
dependencies { testCompile sourceSets.testData.output }
Can't really reproduce this... the plugin won't do anything unless you specify test sets in the build script.
Additional test runtime classpath becomes not visible during test execution when plugin
test-sets
applied. Test fails with NoClassDefFoundError.How to reproduce:
Create two source sets in build.gradle:
Create some class in testData and create Test, which has reference to it.
Run gradle build - SUCCESS
Add test-sets plugin
Run gradle build - crashed during test execution phase with "> initializationError FAILED java.lang.NoClassDefFoundError: < class from testData >"
More investigations:
build/classes/java/testData
exist thereWorkaround: specify dependency to testData in
dependencies
section: