Advertisement

基于 Jacoco + Maven + Jenkins 配置下的单位测验覆盖报告

阅读量:

近期,系统进行了重构,要求为底层基础服务增加单元测试用例,我被指派负责生成单元测试覆盖率报告。

第一版内容较为基础,仅提供了一份简要的测试报告,未包含具体的覆盖率数据。

1. 针对maven项目,需进行pom配置

复制代码
 <reporting>

    
     <plugins>
    
     <plugin>
    
         <groupId>org.apache.maven.plugins</groupId>
    
         <artifactId>maven-surefire-report-plugin</artifactId>
    
         <version>2.4.2</version>
    
     </plugin>
    
     </plugins>
    
 </reporting>
    
    
    
    

2. Jenkins配置中,需在待测服务的配置文件中进行如下设置

构建脚本内容为:mvn clean surefire-report:report

![](http

全部评论 (0)

还没有任何评论哟~