4

In case of jacoco - we can skip packages which should not be considered for code coverage. I want to exclude some methods from Java class, not the whole class. Can we specify specific which can be excluded?

If yes, where and what configuration changes are required.

I don't want to add annotations on the methods which needs to be excluded. Is there any way to configure. Like if we list down all the methods in 1 file and while executing code coverage, read that file via some configuration and exclude those methods. Is this possible ?

  • Possible duplicate of [How would I add an annotation to exclude a method from a jacoco code coverage report?](https://stackoverflow.com/questions/47824761/how-would-i-add-an-annotation-to-exclude-a-method-from-a-jacoco-code-coverage-re) – Godin Oct 23 '18 at 13:17
  • I don't want to add annotations on the methods which needs to be excluded. Is there any way to configure. Like if we list down all the methods in 1 file and while executing code coverage, read that file via some configuration and exclude those methods. Is this possible ? – Snehal Pokharkar Oct 24 '18 at 03:53
  • From the mentioned answer - "Only whole classes can be excluded." – Godin Oct 24 '18 at 13:46

0 Answers0