SonarQube+jococo+Hybris

Hi @Antoine,
I am using latest version of sonarqube and hybris 1905 , I need to know how can I find code coverage?

Confusion points :

  • do I need to install any jococo plugin in sonarqube? Or is it already part of hybris 1905 ?
  • I didnot find target for ant jacocoalltests, do i need to create ant task ?
  • do I need to change anything in sonar.xml in hybris?

Please help to clear above doubts as I didn’t find any documentation for above and it becomes very difficult to integrate code coverge for hybris.

Hello @Amit_Malhotra,

I can’t really elaborate on the Hybris plugin since this is a 3rd party community plugin not maintained by SonarQube, you may ask questions related to this plugin to the maintained on GitHub.
For what concerns SonarSource deliverables:

  • do I need to install any jococo plugin in sonarqube? Or is it already part of hybris 1905 ?

You definitely need to install the Jacoco plugin

Wow, still using Ant for your builds ! :grimacing:
No matter how you do that, you have to make sure that your run Jacoco after building the code and before running the scanner. I am not familiar enough with Ant to tell you if there’s an Ant task for that, or if you simply have to run Jacoco from the “command line”.
Bottom line, you have first to produce the Jacoco XML report and pass this report path to the scanner in the sonar.coverage.jacoco.xmlReportPaths property

Olivier