Connect SonarQube to Jenkins
This setup lets Jenkins run code analysis during pipeline execution instead of treating quality checks as a separate manual task.
Step 1: Install the Plugin
- Open Jenkins.
- Go to Manage Jenkins > Manage Plugins.
- Search for SonarQube Scanner.
- Install it and restart Jenkins if required.
Step 2: Add the SonarQube Server
- Go to Manage Jenkins > Configure System.
- Find the SonarQube servers section.
- Click Add SonarQube.
-
Fill in:
-
Name:
SonarQube - Server URL:
http://your-sonarqube-server:9000 - Server authentication token: generate this in SonarQube under account security settings
Why This Matters
Once Jenkins knows the SonarQube server, pipelines can:
- Send analysis results automatically
- Wait for quality gate status
- Fail a build when code quality does not meet the standard
Next Step
Use the example in pipeline-example.md to add scanning to a real pipeline.
Official reference: SonarQube Jenkins integration