Exclude Packages from Jacoco Report Using Sonarrunner and Gradle
Is There a Way to Exclude Packages from Sonarqube(Instrumented by Gradle + Sonar-Runner) Coverage Reports(Generated by Jacoco) Without Excluding Them...
Is there a way to exclude packages from SonarQube(instrumented by gradle + sonar-runner) coverage reports(generated by jacoco) without excluding them completely from the project ?
Below is what i tried so far:
Version information
- SonarQube 4.5.1
- Gradle 2.2.
Must Read
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())
}
}
}