Find code coverage for multi module maven project

强颜欢笑 提交于 2019-12-11 04:47:40

问题


I have a multi module maven project in one git repository and my integration test cases on another git repository. The output of multi module maven project is three jars for three modules. Now is there a way via command line (so that we can run this through jenkins) to find code coverage for integration tests that are in another repository. The JAR when ran through java -jar <<jarname>> it starts a jetty server with the application.


回答1:


You can execute your jar with JaCoCo agent to gather coverage data - http://www.jacoco.org/jacoco/trunk/doc/agent.html

And write a small Ant-script to combine classes, sources and coverage data for generation of report - http://www.jacoco.org/jacoco/trunk/doc/ant.html

Note that generation of report requires exact same classes that were used during execution of tests - http://www.jacoco.org/jacoco/trunk/doc/classids.html



来源:https://stackoverflow.com/questions/42088458/find-code-coverage-for-multi-module-maven-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!