We are using Azure devops pipeline with sonar cloud integration and code coverage is showing in Azure Interface pipeline code coverage tab as shown in attachment but not showing in sonar cloud. Tasks sequence shown in screenshot below.
In prepare analysis for sonar cloud task, path is explicitly set where jacoco.xml is available,sonar.coverage.jacoco.xmlReportPaths=/home/vsts/work/1/s/development/CCReport43F6D5EF/jacoco.xml and same is set in maven/pom.xml options as
-Dsonar.coverage.jacoco.xmlReportPaths=/home/vsts/work/1/s/development/CCReport43F6D5EF/jacoco.xml
Can you point why the coverage is not coming in sonar cloud.
The options field in the Maven task is definitely not a good place to put any properties for the SonarCloud analysis.
Prepare analysis configuration can be, but make sure you donât put any -D in front of the property, you can simply put âsonar.coverage.jacoco.xmlReportPaths=/home/vstsâŠâ in the additional properties field.
Make sure also that you donât set that property twice, so either choose the pom.xml of the additional property fields, it will help you troubleshoot in that specific case.
Hi @mickaelcaro - Path is correct. But it is setting both -Dsonar.jacoco.reportPaths and -Dsonar.coverage.jacoco.xmlReportPaths and looks on sonar cloud its not able to read Dsonar.coverage.jacoco.xmlReportPaths
as warning is coming on sonarcloud interface
Property âsonar.jacoco.reportPathsâ is no longer supported. Use JaCoCoâs xml report and sonar-jacoco plugin.
sonar.jacoco.reportPaths can be set for some cases where it should be still supported (older version of SQ and subsequent analyzers for instance).
The sonar.coverage.jacoco.xmlReportPaths is set automatically by the Maven task, so finally, you donât need to set it up on your own as long as you are relying on default paths for the coverage xml file to be written.
We are not trying to use it, but as it is not supported anymore on our side, we are stil detecting it and display a warning that is shouldnât be used anymore.
ok @mickaelcaro. So need to identify why sonar cloud is not able to read the jacoco.xml from azure though same works fine when its run from local set up.
I donât think itâs enough then. Could you please add the pipeline variable âsystem.debugâ and set it to true please to see if it changes something ?