I wrote a custom annotation to ignore classes and methods while generating Jacoco coverage report. Please refer to code below:
@Target({ElementType.TYPE,ElementType.METHOD,ElementType.CONSTRUCTOR})
public @interface ExcludeFromJacocoGeneratedReport {
}
This is working fine in my local but when I am running a Jenkins pipeline, classes and methods marked with this custom annotation are not getting ignored in Jacoco coverage report.
Please guide me if I have missed something or some explicit configuration is required before running jenkins pipeline in this case.