maven - JaCoCo xml 报告自定义名称。合并 XML 文件
问题描述
由于新版本的声纳,JaCoCo 二进制报告不再可能。
我有一个包含多个模块的项目,并且在**/target/site/report.xml
报告阶段创建了 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>
谢谢,德拉戈斯。
解决方案
推荐阅读
- javascript - 错误:使用 Formik 和传递值时,对象作为 React 子项无效
- google-apps-script - 使用 Google 表单中的数字答案在 Google 表格中为 Google 表单中的动态文本选择行号?
- api - 从通道名称中获取松弛通道详细信息
- python - 读取二进制文件并检查python中的匹配字符
- git - 有没有办法用历史备份特定的分支?
- php - 通过 WooCommerce 中的 URL 获取并设置自定义产品价格添加到购物车
- firebase - Firestore - 使用 FirebaseAuth 的 uid 作为进一步关系的文档索引的好习惯
- kotlin - net.corda.nodeapi.internal.persistence.CouldNotCreateDataSourceException:无法创建数据源
- javascript - React Native(Android):无法通过 JNI 在作业中返回字符串
- c++ - 使用矢量化数据进行高效的并行张量收缩