/TeamCity.SonarQubePlugin

A plugin for TeamCity server allowing you to configure and run SonarQube analysis from the CI

Primary LanguageJavaApache License 2.0Apache-2.0

official JetBrains project License Build Status

TeamCity SonarQube plugin

This plugin allows configuring and running SonarQube analysis on the TeamCity server.

1. Downloading binaries

The latest build of the plugin is available on the public TeamCity server and can be downloaded from the public TeamCity server:

2. Building sources

From the TeamCity build targeted version bundle, copy into repository/lib the JAR file(s) from webapps/ROOT/WEB-INF/lib/: mvn install:install-file -DgroupId=org.jetbrains.teamcity -Dpackaging=jar -DartifactId=server-tools -Dversion=2019.2 -Dfile=./.idea_artifacts/web_deployment_debug/WEB-INF/lib/server-tools.jar

  • server-tools.jar
  • common-tools.jar (if exist, useless since TeamCity v2019.x)

And run the following command in the root of the checked out repository:

mvn clean package

3. Installing

Install the plugin as described in the TeamCity documentation.

4. Key features

  • Build step to run SonarQube Runner analysis

The most used properties can be configured via the TeamCity UI in a convenient way. Maven test results and JaCoCo code coverage results will be sent to the SonarQube Server automatically.

  • Connections to SonarQube Server locations to send information from the SonarQube Runner

Any number of SonarQube Server connections can be defined for a project. A connection can be used in any Build Configuration under the project including those from subprojects.

The 'Edit project' permission is required to manage SonarQube servers (add/edit/remove, and view account).

  • SonarQube Branches & Pull Requests Build Feature

Branches and Pull-Requests analysis parameters automatically provided on build from VCS build information, using SONARQUBE_SCANNER_PARAMS environment variable. It requires TeamCity v2019.2 and SonarQube Developer Edition or above.

  • Build Breaker plugin integration

TeamCity will add build problems according to the results of the Build Breaker. TeamCity will look for the Build Breaker messages in the build log and parse them to produce TeamCity Build Problems.