I've spent the day yesterday up and down StackOverflow and Google and have come close to some solutions, but nothing is working. I hope someone could just tell me whether this is even possible.
We have a multi-module Maven project. I just learned that the structure is like this:
Web Service XYX
+- pom.xml
+- Web Module
+- pom.xml (parent pom is WebService 123)
+- API Module
+- pom.xml (parent pom is API ABC)
+- API Implementation
+- pom.xml (parent pom is API ABC)
What I have done is setup UT and IT Code Coverage from Jacoco to Sonar via Jenkins. The UT Coverage gets sent to Sonar correctly for the UT combined.
The IT Coverage is always 0%. My IT is run against the Web Module after starting the WAR up using the Maven Tomcat plugin. The code that it should be exercising lives inside the module API Implementation. Even though a jacoco-it.exec
file was generated and analyzed by Sonar, it always shows me that no lines of code were hit. Is there a way to actually do this?
BTW - I know it can be done because this article indicates exactly what I need: http://www.sonarqube.org/measure-code-coverage-by-integration-tests-with-sonar/
However, the article fails to mention if the modules are referred to the same parent in the project. I'm making an assumption that it does.