java - Jacoco report-aggregate - 包括聚合项目的报告
问题描述
我有一个多模块 Maven 项目。
parent
child1
child2
child3-report
所有子项目都有单元测试,并且child3
依赖于child1
和child2
。跟随 child3 的 pom
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.2</version>
<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>
</executions>
</plugin>
生成的 jacoco 聚合报告仅包含 child1 和 child2 的报告,但不包含 child3 的报告。如何解决这个问题?
不想仅为报告创建第四个子模块。
解决方案
我所做的是添加一个报告目标以包含模块本身的报告。
<execution>
<id>report-unit-tests</id>
<goals>
<goal>report</goal>
</goals>
</execution>
推荐阅读
- html - Margin-left 将 div 推到 > 100%,我不知道如何解决它
- android - 在片段部分使用 YoutubePlayerView
- r - ggplot2在R中按组拆分
- angular - chrome 检查器显示错误定位的元素与 recaptcha
- c++ - 在cpp中除以大数时查找大二进制字符串的余数
- visual-studio - 如何防止其他 Visual Studio Online 团队成员重新分配任务?
- android - 使用 aapt 构建新的 Android App Bundle 失败
- node.js - Heroku 使用 Git Node.js 部署 multer 上传文件夹 检查文件
- nem - 多重签名钱包未转换。为什么聚合交易不返回错误?
- sas - 寻找最相似的短语