-
Improvement
-
Resolution: Fixed
-
Major
-
None
-
-
1381.v08b_63fa_30559
The jacoco report published by pipeline indicates classes that should have been excluded.
Our build, a multi-module maven build executes jacoco on multiple modules. In the POM, we indicate <exclude> on a number of classes (generated java). When built by maven (command-line), the jacoco report is properly created - excluded files are properly excluded. When we wrapper this build into a jenkinsfile and invoke it via a withMaven(..), the JacocoPublisher kicks in. The jacoco report on the Jenkins job appears to include the excluded files. It looks to me like JacocoPublisher is reinvoking Jacoco-Plugin with default parameters. The Jacoco-Plugin output shows a blank line for 'exclude', which explains why the report has things it should not.
I suspect the easiest solution is to offer a parameter on JacocoPubisher that would pass-through to the Jacoco-Plugin. This would allow people to write Jenkinsfiles, enter the 'excludes' they desire, and Jacoco-Plugin would then run properly.
- links to
Found a work-around of sorts. Completely disable the JacocoPublisher and use the external 'jacoco' step instead. Since the latter accepts exclude, it can be properly configured. If you don't disable the JacocoPublisher, you wind up with two similar looking reports in Jenkins.