1

I am developing a plugin for SonarQube 6.3.1 which execute an analysis and then generate a docx report.

The problem is that I have to wait between these both actions that SonarQube finishes its REPORT task. My plugin is destined to lambda users so without Administrator permissions: so I can not use activityStatus service.

Is there an other way to know if the reporting of a project in SonarQube is terminated? (inside a plugin)

G. Ann - SonarSource Team
  • 22,346
  • 4
  • 40
  • 76
begarco
  • 751
  • 7
  • 20

1 Answers1

1

Your analysis take place on the server side ? I think you should run it on a client side, not server side.
Write a plugin with @BatchSide and implements org.sonar.api.batch.postjob.PostJob.
Then your method will execute soon analysis is finish (as you requested) See https://github.com/SonarSource/sonar-custom-plugin-example/blob/master/src/main/java/org/sonarsource/plugins/example/hooks/DisplayIssuesInScanner.java

And by the way with PostJobContext object you have all infos you need to fill a custom report

Maxence Lecointe
  • 238
  • 5
  • 11
  • But using @ScannerSide (@BatchSide is deprecated in version 6.3.1) I can not know when SonarQube has finished to import data from scanners. My aim is to have a reporter which can be used from every client not only from the client which ran the analysis. – begarco Jun 23 '17 at 08:02
  • 1
    look at https://github.com/SonarSource/sonar-custom-plugin-example/blob/master/src/main/java/org/sonarsource/plugins/example/hooks/DisplayQualityGateStatus.java it is exactly you want – Maxence Lecointe Jun 23 '17 at 08:34