Configure SonarQube scans on Jenkins pipelines
-
- UpdatedJan 30, 2025
- 2 minutes to read
- Yokohama
- DevOps
Configure SonarQube scans on Jenkins pipelines.
Before you begin
- SonarCloud or SonarQube version 8.6.1 community edition
- SonarQube Scanner for Jenkins 2.4 or higher is installed on your Jenkins instance/environment.
- ServiceNow DevOps plugin version 1.27 or later for Jenkins.
- Ensure that SonarQube scans are configured and exist on your Jenkins pipelines using the SonarQube Scanner plugin for Jenkins. For more information, see
- A SonarQube tool is created and is connected to the SonarQube server. For more information, see SonarQube integration with DevOps Change Velocity.
About this task
When you run a pipeline which has SonarQube scan executions, the details are fetched into ServiceNow
DevOps from the Jenkins pipeline. Using the Jenkins plugin, we check if the scan execution is configured in the Jenkins pipeline and check for SonarQube scans on every orchestration stage, using the
withSonarQubeEnv
tag. If a SonarQube analysis has happened on any stage of the pipeline’s execution, as part
of our end notification we add a model with the scanID
and url
details for every scan that occurs in a particular stage. These scan analytics or details are correlated and displayed in the
Software Quality Summary related list from Change requests and Task executions.
Procedure
Result
What to do next
Navigate to the pipeline UI to view the scan details under the
.- View scan details as part of Task Executions. View details of all the Sonar scans that are part of the task execution mapped to a build or release pipeline execution step.
- Navigate to click a relevant Task Execution record.
- Click the Software Quality Summary related list.
- Click a relevant Scan ID record.
- View scan details as part of Change Request. View all the scans that were part of this build/release pipeline in the
- Navigate to
- Click the Software Quality Summary related list.
- Click a relevant Scan ID record.
related list.