Skip to content
Gradle-Plugin that allows projects to be analyzed by sonarqube even if they contain sources as well as sub-modules
Groovy Shell
Branch: master
Clone or download
Latest commit d0383f0 Nov 14, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle
src
.gitignore
.travis.yml
LICENSE
README.md
build.gradle
gradlew
gradlew.bat
settings.gradle
travis.sh

README.md

SonarQube-Multi-Project-Plugin for Gradle

Build Status

Note: since SonarQube 6.4 the scanner can analyse gradle-projects containing sources and sub-projects by itself, so there is no need to use this plugin anymore!

This plugin extends the SonarQube Scanner for Gradle 2.5 and allows you to analyze multi-module builds with SonarQube < Version 6.4 even when the root-project has its own source-files (that is, it implements a fix for SONARGRADL-5).

See https://github.com/Argelbargel/multi-module-gradle-project-sonarqube for an example project using this plugin.

Documentation

1. Apply plugin to your project

This also applies the default sonaqube-plugin to your project

Using a buildscript-block and apply (supported by all Gradle-Versions)

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "gradle.plugin.argelbargel.gradle.plugins:sonarqube-multiproject-plugin:1.1"
  }
}

apply plugin: "argelbargel.gradle.plugins.sonarqube-multiproject-plugin"  

Using the new plugin-mechanism

plugins {
    id "argelbargel.gradle.plugins.sonarqube-multiproject-plugin" version "1.1"
}

Apply the plugin via a separate, reusable script

sonarqube-multiproject.gradle
buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "gradle.plugin.argelbargel.gradle.plugins:sonarqube-multiproject-plugin:1.1"
  }
}

apply plugin: Class.forName('argelbargel.gradle.plugins.sonarqube.SonarqubeMultiProjectPlugin')
build.gradle
apply from: 'sonarqube-multiproject.gradle'

2. (Optionally) configure name of root-module

The Plugin extends the default-configuration of the sonarqube-plugin by adding an optional property for the name of the module which is created if the root-project contains its own sources.

 sonarqube {
     properties {
         // ... default sonar properties
         property 'sonar.rootModuleName', 'main' 
     }
 }

The above configuration will create a Module "main" in your Sonarqube-Server below your project which contains the analysis of the source-files in the root-module.

If no name is configured for the root-module, the name of the root-project will be used.

License

Licensed under the GNU Lesser General Public License, Version 3.0

You can’t perform that action at this time.