Prepare Sonar Task is not picking up the Cobertura file. Is looks for Jacoco even though I try to install Cobertura

task: SonarCloudPrepare@1

inputs:

SonarCloud: ‘SonarCloud-01’

organization: ‘’

scannerMode: ‘CLI’

configMode: ‘manual’

cliProjectKey: ‘’

cliProjectName: ‘’

cliSources: ‘src’

extraProperties: |

Additional properties that will be passed to the scanner,

Put one key=value per line, example:

sonar.exclusions=**/*.bin

sonar.sources=.

sonar.tests=src

sonar.test.inclusions=/tests/,**/*.spec.ts

sonar.core.codeCoveragePlugin=cobertura

sonar.cobertura.reportPaths=$(System.DefaultWorkingDirectory)/coverage/coverage-cobertura.xml

displayName: 'Prepare SonarCoud analysis

Hello @archi,

From the logs, you can indeed see that JaCoCo report importer is executed and don’t manage to import any coverage, but this is expected, as this sensor is always executed, and this does not prevent another sensor to import coverage.

If I understood correctly, you are trying to import coverage for Java code, obtained thanks to Cobertura, correct?

To my knowledge, sonar.core.codeCoveragePlugin is an old property and not used anymore. In addition, where did you find that you had to use sonar.cobertura.reportPaths?

I am trying to import coverage for a react app. Basically jest coverage.

I think I saw some post from where I happened to copy sonar.cobertura.reportPaths.

From this post:

the only option to import Cobertura reports for Java is to use sonar-cobertura […]

This plugin is not included by default in SonarQube though, blindly adding sonar.cobertura.reportPaths is therefore not enough to import coverage. You need to install it.