Search code examples
sonarqubejacoco

Sonar Jacoco Excludes sonar.jacoco.excludes causes 0% coverage instead of ignored.


When I write

<sonar.jacoco.excludes>*.model.*</sonar.jacoco.excludes>

The package is not excluded from instrumentation / reporting and coverage shows as 0%

Why is this ?

Sonar version 3.6


Solution

  • Common pitfall to use the wrong pattern to exclude. Notice the .

    Bad :

    <sonar.jacoco.excludes>*.model.*</sonar.jacoco.excludes>
    

    Good:

    <sonar.jacoco.excludes>*model*</sonar.jacoco.excludes>
    

    Documentation for weary travellers.