maven jacoco: not generating code coverage report

后端 未结 4 592
感情败类
感情败类 2020-12-14 02:23

I am trying to setup jacoco for my project\'s code coverage

My project is based on Java 1.8

Here is how things look in my project

4条回答
  •  再見小時候
    2020-12-14 02:49

    Any particular reason why you are using an outdated version of the JaCoCo plugin? For Java 8 support, you have to use at least version 0.7.0 (see changelog).

    In your configuration, the report goal is bound to the verify phase, so running mvn test won't generate any report because it does not run the verify phase (test phase comes before verify). You have to use mvn verify to execute tests and generate the report.

    The JaCoCo project provides example Maven configurations. You can try "this POM file for a JAR project runs JUnit tests under code coverage and creates a coverage report".

提交回复
热议问题