Error submitting job to SonarCloud using Gradle


(Vitaly Karasik) #1

We added Sonar as GitHub application and started onboarding process.
This onboarding wizard suggests the following example for Gradle:

./gradlew sonarqube \
  -Dsonar.projectKey=_my_project_key_ \
  -Dsonar.organization=_my_organization_ \
  -Dsonar.host.url=https://sonarcloud.io \
  -Dsonar.login=_my_token_

But this command fails with:

"Property 'sonar.abap.file.suffixes' is not declared as multi-values/property set but was read using 'getStringArray' method"
.......
 Error during parsing of generic test execution report '...build/test-results/jest/TESTS-results-sonar.xml'. Look at the SonarQube documentation to know the expected XML format.

And my project’s status in SonarCloud is “Project is not analyzed yet”.

What I’m missing?

My environment:
Gradle 4.10.2
“org.sonarqube” version “2.7”


(Fabrice Bellingard) #2

Can you please copy-paste more of the end of the analysis log, where the analysis fails? It will be easier to help you.


(Vitaly Karasik) #3

Fabrice, thank you - I’m attaching “./gradlew sonarqube . …” output.
gradle_sonarcloud.txt (5.9 KB)
Vitaly


(Fabrice Bellingard) #4

Looks like there is a problem with the test results XML file. How do you generate it? Does the analysis succeeds if you remove this file?


(Vitaly Karasik) #5

Sorry for not updating this topic - yes, I fixed Sonar scan by commenting out this report and ignoring C/C++ files. My Gradle project combines Java and Angular.


(Fabrice Bellingard) #6

OK, so I guess that the scanner gets fooled by the availability of a jest report which is not in the expected format for the Java code coverage.

Did you manage to have code coverage on your project though?