Everything fine with the usual three projects.
Except the stuff mentioned here but I didn’t expect it to be fixed since we couldn’t pinpoint the problem so far.
Regarding the new compileOnly
:
Unlike provided
with the propdeps-plugin, compileOnly
is not written to the resulting Maven pom as a provided
dependency. Not sure if this is intended…
Regarding the IDEA plugin:
We also have the following code in our Gradle files.
idea.module {
iml.withXml {
def attributes = it.asNode().component.content.sourceFolder
.find { it.@url == 'file://$MODULE_DIR$/src/test/resources' }
?.attributes()
if(attributes) {
attributes.remove('isTestSource')
attributes.put('type', 'java-test-resource')
}
}
iml.withXml {
def attributes = it.asNode().component.content.sourceFolder
.find { it.@url == 'file://$MODULE_DIR$/src/main/resources' }
?.attributes()
if(attributes) {
attributes.remove('isTestSource')
attributes.put('type', 'java-resource')
}
}
inheritOutputDirs = false
outputDir = file("$buildDir/classes/main/")
testOutputDir = file("$buildDir/classes/test/")
}
This ensures that main and test resources are registered properly in IDEA 15. It seems something has changed in the .iml
IDEA files with IDEA 15. Without the above code, tests aren’t able to find resources addressed by getClass().getResourceAsStream()
if executed in IDEA.
You might consider adding this or something similar if you are working on the idea plugin anyway.