This works fine from the command line but IntelliJ displays the integrationTest sources as if they were source and not test source.
Gradle code:
sourceSets {
integrationTest {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/it/java')
output.classesDir = "$buildDir/classes/it"
}
def resourceDir = file('src/it/resources')
if (resourceDir.exists()) {
resources.srcDir resourceDir
output.resourcesDir = "$buildDir/resources/it"
}
}
}
It's an IntelliJ bug. Please vote for it.