[英]Find combined code coverage of unit tests and integration tests written in different maven projects
-Project-A(API)
----src
---main(Main code is written here)
---test(Contains Service layer tests)
---pom.xml
-Project-B(APIClientTests)
----src
---main
---test(Contains Client tests)
---pom.xml
My project structure looks like this. 我的项目结构如下所示。 I would like to know that is there any way to calculate code coverage of code written in main of Project A, by running the integration tests written in Project A and JUnit tests written in project B.
我想知道有什么方法可以通过运行以项目A编写的集成测试和以项目B编写的JUnit测试来计算以项目A的主体编写的代码的代码覆盖率。
Use Jacoco and parent pom : 使用Jacoco和parent pom:
parent pom 父母pom
+Project-A +Project-B
in parent pom : 在父pom中:
<plugins> <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.