sonar 测试覆盖率

 <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.8.2</version>
        <executions>
          <execution>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <destFile>${sonar.jacoco.reportPaths}</destFile>
          <excludes>
            <exclude>com.myProject.MyTopologyLauncher</exclude>
            <exclude>com.myProject.APackage.*</exclude>
          </excludes>
        </configuration>
      </plugin>

      

      <plugin>
        <groupId>org.sonarsource.scanner.maven</groupId>
        <artifactId>sonar-maven-plugin</artifactId>
        <version>3.5.0.1254</version>
      </plugin>

<sonar-jacoco-listeners.version>5.9.1.16423</sonar-jacoco-listeners.version>
<sonar.language>java</sonar.language>
<sonar.libraries>target/*.jar</sonar.libraries>
<sonar.junit.reportsPath>build/test-reports</sonar.junit.reportsPath>
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>

原文地址:https://www.cnblogs.com/tonggc1668/p/8953780.html