简体   繁体   English

如何配置Maven-cobertura-plugin来检测依赖项jar

[英]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.

相关问题 如何在maven-cobertura-plugin中运行cobertura测试? - How do I configure when cobertura tests run in maven-cobertura-plugin? 常春藤无法解决Maven-cobertura-plugin - Ivy cannot resolve maven-cobertura-plugin Maven找不到maven-plugins:maven-cobertura-plugin - Maven failure to find maven-plugins:maven-cobertura-plugin Maven依赖罐中的Taglib。 如何在web.xml中配置此taglib? - Taglib inside Maven dependency jar. How do I configure this taglib inside the web.xml? 我如何在使用Maven为Linux上的Jenkins编译cobertura-plugin时解决丢失的工件 - How do i resolve missing artifact while using maven to compile cobertura-plugin for Jenkins on linux 使用cobertura maven插件时,如何设置cobertura数据文件的位置? - How can I set the location for the cobertura data file when using the cobertura maven plugin? 我如何在与Maven中的依赖项jar相同的路径上复制文件? - How do I copy a file on the same path as a dependency jar in Maven? 如何强制 Maven/Eclipse 下载 JAR 依赖项? - How do I force Maven/Eclipse to download a JAR dependency? 我如何正确整合Maven,Jenkins,Sonar和Cobertura? - How do I correctly integrate Maven, Jenkins, Sonar and Cobertura? 如何配置Jenkins Maven存储库插件? - How do I configure Jenkins Maven Repository Plugin?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM