Are you generating binary (EXEC) format files or XML files? The newer versions of the JaCoCo plugin do not analyze the binary format.
Look in the log of your Sonarqube scan for messages about whether or not it found the JaCoCO file and analyzed it. Is your file being created in the location specified in the sonar.coverage.jacoco.xmlReportPaths property? Is it the property set as part of your scan properties? Is there a default value in Administration->JaCoCo?
To troubleshoot further will require logs of the analysis running in debug mode, as stated in your previous screenshot. You can activate debug logging by adding the property sonar.verbose=true to the Advanced area of your Prepare Analysis task within your pipeline. Please post the logs resulting from the next pipeline run after doing this.
Ah, my apologies, my suggested mechanism for enabling debug logging won’t affect running maven within a later pipeline step. You’ll need to enable debugging within the maven task. Can you add the debug (-X) parameter to the maven command in that task? And then please supply the log.
One thing I noticed which seems odd: you are passing the coverage report in to the maven command from outside, via -Dsonar.coverage.jacoco.xmlReportPaths=/home/vsts/work/1/s/CCReport43F6D5EF/jacoco.xml
Whereas you’re running JaCoCo within the build again, apparently only generating .exec format files, and then not recreating an aggregate XML file. Somewhere in here, I suspect, lies your issue.
The parameter -Dsonar.jacoco.reportPaths should no longer be passed as it was deprecated and ultimately removed. And I remain curious why -Dsonar.coverage.jacoco.xmlReportPaths=/home/vsts/work/1/s/CCReport43F6D5EF/jacoco.xml is being passed in from outside; the JaCoCo XML report should really be generated within this build.
I don’t have control over what is passed from the Maven Task (it is Azure DevOps native task for Maven).
I know about the deprecated stuff but note that one day this config already worked. Plus we are getting the Jacoco code coverage. Just not in SonarQube.