是否可以从测试范围中排除Java类?

时间:2019-11-29 09:04:07

标签: eclipse spring-boot junit

我想知道使用Spring Boot和Eclipse是否可以进行一些配置,以便在项目覆盖率的百分比中不考虑某些类的覆盖率。

1 个答案:

答案 0 :(得分:0)

  you are using jacoco plugin u can use like below 
    <plugin>
      <groupId>org.jacoco</groupId>
      <artifactId>jacoco-maven-plugin</artifactId>
      <version>${jacoco.mavenplugin.version}</version>
      <configuration>
          <excludes>
               <exclude>some/package/**/*</exclude>
          </excludes>
      </configuration>
      <executions>
          ...
      </executions>
    </plugin>

请在下面参考

Maven Jacoco Configuration - Exclude classes/packages from report not working