问题
From the past one week I am trying to get code coverage of my multi module project using Sonar. My project structure is as follows.
Web Service XYX
+- pom.xml
+-SubFOlder
+- Module 1
+- pom.xml
+- Module 2
+- pom.xml
+- Module3
+- pom.xml
Means I have one folder in my directory and inside that I have all my sub modules. am able to generate a jacoco.exec file in all the sub modules target directory. Want to know the way to combine all these submodules jacoco.exec so that I can get a merged code coverage in sonar report.
回答1:
As I've answered here: You can put all the reports together in one folder (don't forget to call the different!) and use the merge mojo for that, or use a central unique file to all your reports by adding the flag "append":
-javaagent:append=true,destFile=/home/YourProject/report.exec
Here you'll find more information about how to configure the agent.
Hope it helps!
来源:https://stackoverflow.com/questions/39193723/how-to-configure-multi-module-maven-sonar-jacoco-to-get-overall-coverage-rep