When I configured in Gradle file modules with these properties at the very beginning, all files were scanned. But since I needed to include all the modules in the report, I moved them to the gradle root
Hi
Honestly, I donāt think this has anything to do with the version, because with ver 3, when defining properties in the gradle module, sonarqube read Kotlin
After updating I get an error in BuildExceptionReporter package org.gradle.internal.buildevents
What went wrong:
Execution failed for task ā:sonarqubeā.
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ā)
Use in project Gradle ver 8.0.2 AGP 8.0.2
So youāve upgraded, but are still seeing an error? Can you provide full, debug analysis logs?
The analysis / scanner log is whatās output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.
Hi,
Yes, thatās right, let me remind you that when I declared sonarqube and its properties in the garadle module, it scanned Kotlin, and when I brought it to root, it stopped transferring log.txt (7.1 MB)
Based on the log you posted, it seems your analysis command was this?
+ gradle sonarqube\
I.e. you didnāt add the --debug specified in the guide I linked earlier?
That means that in 78k lines of logging, thereās no analysis logging, only the mention of the task and about 2k lines about missing JaCoCo reports. Thereās nothing to go on here.
Looking back at your OP
This does nothing. You can drop it.
I donāt understand the point of this pair. Your test exclusion covers everything youāve configured for sonar.tests.
And per the docs, sonar.sources, sonar.tests, sonar.projectName and sonar.projectKey default to whatās read from your build environment.
I suggest paring this back a bit and trying again with the --debug flag:
sonar debug.txt (1.5 MB)
there are difficulties with gradle sonarqube --debug, there are a lot of logs, when running on Jenkins the browser crashes when you view them, and locally if you run it shows only the last part, the logs donāt look informative
We use SonarQube (with itās Gradle plugin) in a multi module (150+) Android project (with one Android app module and a mix of many Android-library and Kotlin-only modules). We use custom convention plugins to set up each module properly. In these convention plugins we apply SonarQube plugin per module and set the required properties.
This is working fine. So you should consider moving to a similar approach.
Yeah sure. You still need to apply the plugin to the root project and set the projectKey, token etc. there. In your submodules you then also apply the plugin but only set your exclusions, reportPaths, sonar.tests path and so on.