How to get sonar-report.json file to display sonar issues at gerrit level itself

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube 8.6 community edition, Sonar Scanner Maven plugin 3.8, Gerrit code review 2.16)
  • what are you trying to achieve: We are trying to implement sonar-gerrit jenkins plugin to display the sonar issues at gerrit level itself
  • what have you tried so far to achieve this: I have configured sonar-gerrit jenkins plugin as per listed url and we have specified ‘report-task.txt file’ but sonar-gerrit plugin expecting sonar-report.json file.
    Could you please help me how to generate/get the sonar-report.json file.

URL :https://plugins.jenkins.io/sonar-gerrit/

Thanks
subbu

Hi.

This is not possible. It’s stated on the URL you linked:

Incompatibility with Sonar 7.7

Starting with Sonarqube 7.7 the preview mode (-Dsonar.analysis.mode=preview) was removed, making it incompatible with the plugin.

The support for the preview mode (which was used to generate the sonar-report.json file) was removed a long time ago, in SonarQube 7.7. There isn’t any alternative option for newer SonarQube versions.

Hi Felipe,

Thanks for your reply.

Could you please let us know how to see the sonar issues at gerrit level.

Do we need to configure/check through sonarlint?

Thanks
subbu

Apologies for piggy backing but we currently have the same problem.

Does this mean even if we upgrade to Developer or Enterprise Edition, there still isn’t any alternative?