I'm trying to figure out how to exclude a list of folders from the code coverage report generated by jacoco, which is launched by Jenkins.
It seems possible to exclude classes, but not folders, which is annoying for me as I've started using a pretty big library for an online payment system. Running those unit tests means constantly creating test accounts on that platform and having to delete them again. Every single tine Jenkins runs.
And it would be far simpler to just have the folders excluded than having to exclude every single one of the classes.
To exclude entire directories by changing the Jenkins JaCoCo plugin configuration you would need to add an entry to the 'Exclusions' field.
For instance, if you want to exclude any files under any directory named 'test' you would add the following exclusion:
**/test/**
Keep in mind that if you want to add multiple exclusions you have to separate each one by a comma and there can be no spaces (due to a bug with the plugin).
Here is my JaCoCo plugin configuration: Example JaCoCo Plugin Configuration
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With