/sonarqube-community-branch-plugin

A plugin for SonarQube to allow branch analysis in the community version

Primary LanguageJavaGNU General Public License v3.0GPL-3.0

Quality Gate Status Build Status

Sonarqube Community Branch Plugin

A plugin for SonarQube to allow branch analysis in the Community version.

Support

This plugin is not maintained or supported by SonarSource and has no official upgrade path for migrating from the SonarQube Community Edition to any of the Commercial Editions (Developer, Enterprise, or Data Center Edition). Support for any problems is only available through issues on the Github repository or through alternative channels (e.g. StackOverflow) and any attempt to request support for this plugin directly from SonarSource or an affiliated channel (e.g. Sonar Community forum) is likely to result in your request being closed or ignored.

If you plan on migrating your SonarQube data to a commercial edition after using this plugin then please be aware that this may result in some or all of your data being lost due to this compatibility of this plugin and the official SonarQube branch features being untested.

Compatibility

Use the following table to find the correct plugin version for each SonarQube version

SonarQube Version Plugin Version
7.8 - 8.0 1.3.0
7.4 - 7.7 1.0.2

Installation

Either build the project or download a compatible release version of the plugin JAR. Copy the plugin JAR file to the extensions/plugins/ and the lib/common/ directories of your SonarQube instance and restart SonarQube.

Features

The plugin is intended to support the features and parameters specified in the SonarQube documentation, with the following caveats

  • Pull Requests: Analysis of Pull Requests is fully supported, but the decoration of pull requests is only currently available for Github, Gitlab and Bitbucket Server

Properties

Bitbucket Server

To enable setting of several properties in SonarQube on project level is required.

The property "projectKey" or "userSlug" are mandatory in order to decide which API endpoint should be used.

Contribution

To generate the jar file to copy to your Sonar Server execute ./gradlew clean build inside of the project dir. This will put the jar under libs/sonarqube-community-branch-plugin*.jar

SonarQube / Docker

Add the plugin to the extensions/plugins/ and also into the lib/common/ directory of your SonarQube instance and restart the server.

Quick start to your SonarQube docker container:

version: 2

services:
  sonarqube:
    image: sonarqube
    container_name: sonarqube
    ports:
      - 9000:9000
    networks:
      - sonarnet
    environment:
      - SONARQUBE_JDBC_URL=jdbc:postgresql://db:5432/sonar
      - SONARQUBE_JDBC_USERNAME=sonar
      - SONARQUBE_JDBC_PASSWORD=sonar
    volumes:
      - sonarqube_conf:/opt/sonarqube/conf
      - sonarqube_data:/opt/sonarqube/data
      - sonarqube_extensions:/opt/sonarqube/extensions
      - sonarqube_bundled-plugins:/opt/sonarqube/lib/bundled-plugins
      - sonarqube_common:/opt/sonarqube/lib/common

  db:
    image: postgres
    container_name: postgres
    networks:
      - sonarnet
    environment:
      - POSTGRES_USER=sonar
      - POSTGRES_PASSWORD=sonar
    volumes:
      - postgresql:/var/lib/postgresql
      - postgresql_data:/var/lib/postgresql/data