sonar代码检查增加单元测试覆盖率处理

yun-zuoyi
贾文涛 5 years ago
parent 1320e58ad4
commit a175b34a7e

@ -227,6 +227,41 @@
<useDefaultDelimiters>true</useDefaultDelimiters>
</configuration>
</plugin>
<!-- TestNG 单元测试相关插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
<!-- 单元测试覆盖率相关插件 -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report-aggregate</id>
<phase>verify</phase>
<goals>
<goal>report-aggregate</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<!-- 资源文件位置描述 -->
<sourceDirectory>src/main/java</sourceDirectory>

@ -33,6 +33,7 @@
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
<maven-release-plugin.version>2.5.3</maven-release-plugin.version>
<maven-scm-plugin.version>1.9.5</maven-scm-plugin.version>
<jacoco.version>0.8.4</jacoco.version>
<skipTests>true</skipTests>
<app.charset>UTF-8</app.charset>
<app.jdk.version>1.8</app.jdk.version>
@ -325,9 +326,11 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<skip>${skipTests}</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>

Loading…
Cancel
Save