Is there a way to exclude packages from SonarQube (with gradle + sonar-runner tools) coverage reports (created by jacoco) without excluding them completely from the project?
Below I am trying to do this:
Version Information
- SonarQube 4.5.1
- Gradle 2.2.
Jacoco Configuration
// JaCoCo test coverage configuration tasks.withType(Test) { task -> jacoco { append = false // excluded classes from coverage defined in above configuration excludes = excludedClasses() } jacocoTestReport { doFirst { classDirectories = fileTree(dir: "${buildDir}/classes/main/").exclude(excludedClasses()) } } }
Sonarrunner Configuration
Set properties to exclude a package from sonar analysis. Adding this to my configuration results in packages not being displayed at all in Sonar.
property 'sonar.exclusions', excludedClasses().join(',')
Setting property to exclude packages from jacoco. Setting this leads to a situation where packets are excluded from the analysis of coverage, but find that they have 0%, which accumulate to poor final grades.
property 'sonar.jacoco.exclusions', excludedClasses().join(',')
gradle jacoco sonar-runner
fyr Nov 20 '14 at 7:10 2014-11-20 07:10
source share