首页 > 解决方案 > 多模块项目中的 Java JaCoCo 集成报告

问题描述

我的项目具有以下结构,如下所示。我的集成测试在模块 A 中,它使用其他模块中的类。我希望 JaCoCo 包含由模块 A 执行的其他模块的代码覆盖率。

我知道该插件可以合并其他模块的报告,但这是一个不同的场景。我正在模块 A 上执行集成测试

pom.xml
|
|
-----sub module A - application layer - executable integration-test with submodule B & C
|
|
-----sub module B - business logic - has no integration test
|
|
-----sub module C - business logic - has no integration test

标签: javamaventestingreportjacoco

解决方案


我通过为每个模块添加以下属性解决了同样的问题:

<propertie>
  <sonar.sources>target/generated-sources/java</sonar.sources>
</properties>

推荐阅读