There are no more information on this one, we will do without, that’s fine.
I got another idea while reviewing the config of the maven task : can you check that the “Use XML Jacoco reports for SonarQube analysis” configuration is ticket on the maven task ? It should appear once you’ve selected JaCoCo as coverage tool and enabled SQ analysis.
Also have already tried below option -
removing prepare for analysis task and unchecking sonar analysis checkbox in mvn task and explicitly setting sonar parameters including cloud url etc in Maven Options the way we run in local, this does not show warning of xmlReportPaths attribute on sonar cloud but coverage is 0 on sonar cloud though from local using same mechanism it works. Basically “Run SonarQube or SonarCloud analysis” in maven task is adding deprecated sonar.jacoco.reportPaths.
Hi @mickaelcaro - Have checked the post and have similar structure in the project. To mention, running the sonar from local on the project and connecting to sonar cloud from local generates coverage on sonar cloud but similar using maven task in azure pipeline following same parameters not doing. Also can you please check this post
Which looks exact issue and says that it worked using command line task. Can you check this one what exactly was done to fix.
Do you have some kind of jacoco plugin inside your pom’s, or you rely on the one that is executed by the maven task ?
If yes, my guess would be to simply select “None” in the Code coverage dropdown instead of JaCoCo. Please be sure with that to setup manually or in your pom’s the relevant sonar.jacoco report path properties.
hi @mickaelcaro - Managed to get coverage on sonar by doing below changes -
removing prepare analysis configuration task
updating Maven task to not include any sonar run settings and just do clean install
publishing code coverage to Azure (code coverage publishes in pipeline tab) so that aggregated jacoco.xml file is there
then again including maven task that only does sonar:sonar with all properties to push changes to sonar cloud using parameters
This gave coverage on sonar cloud, though coverage % on sonar cloud vs azure pipeline dashboard has lot difference though both using same jacoco.xml file. Any idea on same if you have.
Please follow my latest instruction, ie in the Maven task, select None as code coverage. With that, the maven task will run the jacoco plugin according to the setting you’ve put in your different poms, including the path to the aggregated coverage xml file.
Usually discrepencies appear as we don’t have the same computation as azure : whole files might not be analyzed, there can be some dependencies linked not analyzed as well, this can lead to coverage percentage not being the same.