0
点赞
收藏
分享

微信扫一扫

Maven工程配置代码覆盖工具Jacoco

yeamy 2022-08-04 阅读 29


介绍

pom中加入

<build>
<plugins>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.5.201505241946</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>post-unit-test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<dataFile>target/jacoco.exec</dataFile>
<outputDirectory>target/jacoco-ut</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>

</plugins>
</build>

执行

mvn clean package

点击targer/jacoco-ut目录下的index.html即可

Maven工程配置代码覆盖工具Jacoco_html


依次点进各级目录查看即可

Maven工程配置代码覆盖工具Jacoco_html_02


举报

相关推荐

0 条评论