Multi-modules with sonar and coveralls

32 views
Skip to first unread message

mathie...@gmail.com

unread,
Nov 17, 2017, 2:57:03 AM11/17/17
to JaCoCo and EclEmma Users
Hello,

Our project is a multi-module project like this:
root
+ module 1
+ module 2
+ module 3
+ module 3.1
+ module 3.2
+ aggregator module

We started coveralls.io 1 year ago. To take into account the cross module tests, we use the report-aggregate goal which is able to retrieve the jacoco.exec files from the dependencies. This works as expected (thanks for that !)

Since few months, we also use sonarcloud.io. The code coverage in sonar is lesser than the code coverage in coveralls. We understand the difference (cross module tests) and we tried to fix it.

I tried to use the jacoco:merge goal but I have to give the list of all jacoco.exec files I want to merge. It’s error prone (it’s easy to forget to add a new module to this list)
It could be great if you can add a feature to retrieve the files to merge from dependencies or if the report-aggregate goal could also generate a merged exec file in addition of the XML, CSV and HTML reports.

I enable the append mode in the jacoco:prepare-agent configuration but it’s difficult to set the destFile. I created a property in the parent pom.xml like this:
<jacoco.destFile>${project.parent.build.directory}</jacoco.destFile>
Due to the project structure, this property have to be changed in several modules (module 3.1 and 3.2 in the example), or simply in module 3 to be inherited by children.

This solution is working but I’m not sure I did things properly. Can I do something more clever?

Thanks !
Mathieu


Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages