[英]How do I configure maven-cobertura-plugin to instrument a dependency jar
I have classes in two modules. 我有两个模块的课程。 One of the modules contains some integration tests that exercise some classes from the other module.
其中一个模块包含一些集成测试,这些集成测试将测试另一个模块中的某些类。 I would like my coverage reports to include classes from both modules but I can't find out how to configure the cobertura plugin so that it will instrument the other module's jar file.
我希望我的覆盖率报告包含两个模块中的类,但是我无法找到如何配置cobertura插件,以便它可以检测另一个模块的jar文件。
I think that is not possible: the unit tests metrics for project A should be complete on their own without executing anything from project B. Unit tests should be written in a manner to cover the code completely. 我认为这是不可能的:项目A的单元测试指标应自行完成,而无需执行项目B的任何操作。单元测试应以完全覆盖代码的方式编写。 However you may consider re-using the testing code between A and B (see
test-jar
goal of maven-jar-plugin
). 但是,您可以考虑在A和B之间重用测试代码(请参阅
maven-jar-plugin
test-jar
目标)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.