Skip to content
This repository has been archived by the owner on Feb 8, 2021. It is now read-only.

SonarQube Quality Gates Task Plugin

Markus Wehrle edited this page Dec 22, 2015 · 8 revisions

Install plugin

Define a quality gate in SonarQube

A SonarQube scan has to be already configured for your project. You can use sonar-runner or maven, gradle, msbuild plugins provided by SonarQube for scanning your project. See analyzing source code in SonarQube documentation for details.

Connect a quality gate with your project

On your SonarQube server go to "Quality Gates" and add your project to a Quality Gate. You can use the predefined "SonarQube way" quality gate or you can define your own rules.

Test your quality gate

After configuring a quality gate for your project run a SonarQube scan on your project. After completion, you will see a quality gate result on the dashboard of your project. (see red box on the screen)

Add and configure a task in your pipeline

Add the SonarQube Quality Gates task to your pipeline

Select "SonarQube - Quality Gate" from add task drop down list.

Configure your task

Enter the project key of your SonarQube project in the task configuration. Your SonarQube project key is displayed at the bottom of your SonarQube project dashboard.

Select if the task will fail on a quality gate warning or error. If there is no quality gate defined for your project, the task will also fail and stop your pipeline. Save the task config and run your pipeline.