How would I add an annotation to exclude a method from a jacoco code coverage report?

后端 未结 4 922
庸人自扰
庸人自扰 2020-12-14 16:13

I have some code in Java that I want to exclude from code coverage. How would I do this? I want to be able to add an annotation. Is there a way to configure or extend jacoco

4条回答
  •  有刺的猬
    2020-12-14 16:19

    You can set lombok.addLombokGeneratedAnnotation = true into lombok.config in the root of project. After that, all Lombok-generated code will be ignored by Jacoco.

    See more in Project Lombok documentation: https://projectlombok.org/features/configuration

提交回复
热议问题