Sonar.coverage.exclusions - Not excluding the package / pattern mentioned @sepandiy #bug

Template for a good bug report, formatted with Markdown:

  • versions used (SonarQube 6.7.5, SonarQube Scanner 3.0.3.778, Jacoco Plugin)
  • error observed (Packages / Files [Java] not excluded in coverage report)
  • steps to reproduce:
sonar.dynamicAnalysis=reuseReports
sonar.java.coveragePlugin=jacoco
sonar.jacoco.reportPaths=$WORKSPACE/ant-jacoco-old-it-codecoverage_results/jacoco/jacoco.exec
sonar.coverage.jacoco.xmlReportPaths=$WORKSPACE/ant-jacoco-old-it-codecoverage_results/jacoco/report/report.xml
sonar.coverage.exclusions=$WORKSPACE/pro/com/ndv/dcbu/*.java*,$WORKSPACE/pro/com/ndv/dcbu/afw/**,$WORKSPACE/pro/com/ndv/dcbu/analytics/**,$WORKSPACE/pro/com/ndv/dcbu/blazeds/**,$WORKSPACE/pro/com/ndv/dcbu/dcm/**

$WORKSPACE/pro/com/ndv/dcbu → This is .java file Location
Also i want to know ‘sonar.coverage.exclusions’ path is .java location (or) .class file location?

Hi,

You’ve got a couple things going on here. First exclusion paths should be relative to project root, not absolute from server root (which is what I’m assuming is specified by $WORKSPACE). Also, they should end with either .java or .*. The one that ends with .java* is okay, since it will also match .java, but the ones that end with ** won’t match any files, since ** is a directory specifier.

 
HTH,
Ann