• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Code coverage with SonarCloud for Maven multi-module project

 
Marshal
Posts: 8857
637
Mac OS X VI Editor BSD Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello ranchers,

I've integrated SonarCloud with Maven project which is a multi-module project. During the build by Jenkins, I do get project analysed.

However, Code Coverage does not get produced. I have some understanding, that having jacoco-maven-plugin within the parent pom file isn't enough, and I need perhaps build coverage reports in each module, and only then in the parent pom somehow specify the location where to find each and every module's individual reports?

Am I thinking towards right direction?

Basically need some advice and tips what I should start researching. Did some already, but nothing concrete could find.

Appreciate for the help.
 
Liutauras Vilda
Marshal
Posts: 8857
637
Mac OS X VI Editor BSD Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A tutorial which you may tried or think is of a high quality would work well too. I just couldn't justify myself which one is a quality one and which one isn't.
 
Liutauras Vilda
Marshal
Posts: 8857
637
Mac OS X VI Editor BSD Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It seems just after posting found something promising https://github.com/SonarSource/sonar-scanning-examples/tree/master/sonarqube-scanner-maven/maven-multimodule
 
Saloon Keeper
Posts: 15510
363
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Liutauras, take a look at the Blackjack repository on GitHub, of which you are also a member I believe. If I recall correctly, code coverage for a multi-module project worked fine there. I used TravisCI instead of Jenkins though.

Here's the link to the SonarCloud page: https://sonarcloud.io/dashboard?id=com.coderanch%3Ablackjack-parent

If you want admin access, let me know.
 
Liutauras Vilda
Marshal
Posts: 8857
637
Mac OS X VI Editor BSD Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry for a late reply. Thanks Stephan. Will look into that.

From the quick glance, I see that actual tests sitting just in one module, but not in others. Interesting how that would behave if tests were spread across more modules. But I guess I can easily check this out by pulling the project and adding some dummy tests to other module(s).

I'm going to work more on this today on my side, so will report back if I succeeded or at least to what extent got some success.

Thanks once again.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic