Sonarqube SONARQUE不能读取多模块项目的父pom目标目录中的集成JaCoCo测试覆盖率
我在这里遵循了为我们的声纳项目启用单元和集成测试的说明: 我的pom设置与本例中给出的设置几乎相同: 父pom设置:Sonarqube SONARQUE不能读取多模块项目的父pom目标目录中的集成JaCoCo测试覆盖率,sonarqube,jacoco,sonarqube5.2,Sonarqube,Jacoco,Sonarqube5.2,我在这里遵循了为我们的声纳项目启用单元和集成测试的说明: 我的pom设置与本例中给出的设置几乎相同: 父pom设置: <profile> <id>code-coverage</id> <build> <plugins> <plugin> <groupId>org.ja
<profile>
<id>code-coverage</id>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<configuration>
<append>true</append>
</configuration>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>default-agent-for-it</id>
<goals>
<goal>prepare-agent-integration</goal>
</goals>
</execution>
<execution>
<id>default-report</id>
<phase>verify</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<excludes>
<exclude>static/**/*.jar</exclude>
<exclude>static/**/*.class</exclude>
</excludes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
代码覆盖率
org.jacoco
单元测试报告很好,但不是集成测试。在竹子日志中,我可以看到sonar正在所有子模块中寻找集成测试和单元测试,但当它到达父模块时,它从未运行JaCoCoSensor或JaCoCoItSensor。这两个传感器都为每个模块项目运行。我还注意到每个模块项目都有一个JaCoCoOverallSensor运行,但父项目没有
如何让JaCoCoItSensor为父项目运行 我添加了一些配置属性,它开始工作
添加了父pom.xml:
<properties>
...
<sonar.jacoco.itReportPath>${project.basedir}/../target/jacoco-it.exec</sonar.jacoco.itReportPath>
<sonar.language>java</sonar.language>
</properties>
...
${project.basedir}/./target/jacoco-it.exec
JAVA
它测试模块I更改:
<destFile>${sonar.jacoco.itReportPath}/../target/jacoco-it.exec</destFile>
${sonar.jacoco.itReportPath}/./target/jacoco-it.exec
为此:
<destFile>${sonar.jacoco.itReportPath}</destFile>
${sonar.jacoco.itReportPath}
父项目是否包含java文件?@benzonico父项目不包含任何java文件。但声纳的例子也不尽相同
<destFile>${sonar.jacoco.itReportPath}</destFile>