Skip to content
Branch: master
Find file History

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.

SonarQube Build Breaker CLI

This CLI checks the pending SonarQube analysis tasks for a given project. It waits until a pending analysis is done. It then breaks the build if:

  • the analysis failed (can happen if the database is corrupt, SonarQube issues, etc.)
  • if the quality gate of the project is in error state (red)

A broken build is signalled with the exit code 1. If everything is okay, the exit code is 0.


The CLI tool expects the URL to the SonarQube instance in an environment variable named SONAR_URL and a SonarQube access token in the environment variable SONAR_TOKEN.

The key of the project which should be checked is provided as the 1st commandline argument.

You can enable debug mode by adding --debug at the end of the commandline.


SONAR_URL="<url to the SonarQube instance>"
SONAR_TOKEN="<SonarQube access token>"

java -jar cli.jar "<key of your project>"

Example with real values


java -jar cli.jar ""
You can’t perform that action at this time.