I confirm the problem with 7.4.0.8496, all our sonar tasks are failing since yesterday
Gradle 9.6.1 here
Task ':query:sonarResolver' uses this output of task ':query:processResources' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed
For more information, please refer to
in the Gradle documentation.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
Possible solutions:
1. Declare task ':query:processResources' as an input of ':query:sonarResolver'.
For more on this, please refer to
in the Gradle documentation.
2. Declare an explicit dependency on ':query:processResources' from ':query:sonarResolver' using Task#dependsOn.
34 actionable tasks: 22 executed, 12 from cache
3. Declare an explicit dependency on ':query:processResources' from ':query:sonarResolver' using Task#mustRunAfter.
I’m facing a similar problem in my JVM only modules on a KMP project. It was introduced by latest gradle plugin release (7.4.0.8496).
Gradle detected a problem with the following location: './subdependency/build/libs/subdependency-jvm.jar'.
Reason: Task ':app:desktop:sonarResolver' uses this output of task ':subdependency:jvmJar' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
As the sonarqube sonarResolver task depends on the generated jar files from submodules and does not declare the dependency on the jvmJar task of those modules, the build is failing. Not sure if the investigation will cover this case given it seems to have the same root cause.
My workaround was adding:
tasks.withType<SonarResolverTask>().configureEach {
val jarTasks = tasks.findByName("jvmJar")
if (jarTasks != null) {
dependsOn(jarTasks)
}
}