Caused by: java.lang.ClassCastException: class java.lang.String cannot be cast to class java.util.Collection (java.lang.String and java.util.Collection are in module java.base of loader 'bootstrap')
at org.sonarqube.gradle.SonarUtils.appendProps(SonarUtils.java:125)
at org.sonarqube.gradle.SonarUtils.appendSourcesProp(SonarUtils.java:130)
Steps to reproduce
We use Gradle Convention plugins(if relevant) and our sources property is like this:
property(“sonar.sources”, “${project.projectDir}/src/main/kotlin”)
Usually, the Sonar Scanner Gradle plugin is able to detect sources automatically, so there should be no need for property(“sonar.sources”, “${project.projectDir}/src/main/kotlin”) . Could you please run the scan without setting the property? Does the issue still happen?
A second option is to replace property(“sonar.sources”, “${project.projectDir}/src/main/kotlin”) with property("sonar.sources", listOf("${ project.projectDir }/src/main/kotlin")).
In case the problem is not solved, can you provide us with a small reproducer? A small project that we can easily run on our side to reproduce this issue.
Hello @JavierSC, there is no plan to do any work on the Gradle Scanner for this year due to the proximity to Christmas and New Year. The issue will be addressed within the first quarter of 2024.