After upgrading to Gradle 7 I have many warnings like:
Execution optimizations have been disabled for task ':<...>:compileJava' to ensure correctness due to the following reasons:
- Gradle detected a problem with the following location: '<...>\build\classes\main'. Reason: Task ':<...>:compileJava' uses this output of task ':<...>:processResources' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
The cause: I redirect output of resources to the same folder as class files - for integration tests reading resources:
sourceSets {
main {
output.resourcesDir = file("build/classes/main")
java.outputDir = file("build/classes/main")
}
test {
output.resourcesDir = file("build/classes/test")
java.outputDir = file("build/classes/test")
}
}
How do I suppress those warnings?