如何解决JaCoCo xml 报告自定义名称合并 XML 文件
自新版 Sonar 起,JaCoCo 二进制报告不再可用。
我有一个包含多个模块的项目,并且 xml 报告是在 **/target/site/report.xml
下创建的
对于报告阶段,遗憾的是没有 <destFile>
配置。
正如我对 .exec
文件所做的那样,是否有可能对 xml 文件这样做?为 xml 报告自定义名称并可能合并它们?
<profile>
<id>jacoco</id>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<excludes>
<exclude>src/main/ui/**/*.js</exclude>
<exclude>src/main/ui/**/*.ts</exclude>
<exclude>src/main/ui/**/*.tsx</exclude>
</excludes>
<!-- Sets the path to the file which contains the execution data. -->
<destFile>${sonar.jacoco.reportPath}jacoco_${project.artifactId}.exec</destFile>
<!-- Sets the name of the property containing the settings for JaCoCo
runtime agent. -->
</configuration>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- Jacoco prepare-agent builds some command-line params without -->
<!-- which jacoco will not instrument. Hence it is important to add -->
<!-- those command-line params here (${argLine} holds those params) -->
<argLine>${argLine} -Xms128m -Xmx512m</argLine>
<forkCount>1</forkCount>
<runOrder>random</runOrder>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<reportSets>
<reportSet>
<reports>
<report>report</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
</profile>
谢谢, 德拉戈斯。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。