SonarQube does not support parallel execution as parallel execution is failing with:
Caused by: org.sonar.api.utils.SonarException: The project is already been analysing
I am using SonarQube v4.3.3
for code inspection.
Now my hudson jobs are running in parallel and due to this restriction I am not able to add sonar analysis to my Hudson job.
Please suggest how can I use SonarQube with hudson in a continuous pipeline using SonarQube.
SonarQube 4.x does support parallel analysis of different projects, but not parallel analysis of the same project. This is a technical constraint to avoid conflicts when persisting analysis into the shared database.
SonarQube 5.2 introduces a major architecture change. Analyzers (launched by your Hudson job) are no more connected to database. They generate and send to server a report that contains only raw data, basically sources and issues. Computation of measures, validation of Quality gate and persistence are done asynchronously on server. In your case that allows analyzers to be executed in parallel, even on the same project, but they can't directly verify Quality gate. For that you should implement a kind of listener on web services to get the gate status when report is processed. See http://docs.sonarqube.org/display/SONAR/Breaking+the+CI+Build for more details. Note also that version 2 of the build breaker plugin implements this solution directly in the analyzer (see https://github.com/SonarQubeCommunity/sonar-build-breaker)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With