Xeperis
Xeperis

Reputation: 1459

SonarQube - java/groovy multimodule project scan

I have:

Configuration:

def sourceProjects = allprojects.findAll { it.file('src/main').exists() }
configure(sourceProjects) {
    apply plugin: 'java'
    apply plugin: 'groovy'
    apply plugin: "org.sonarqube"

    sourceSets.main.java.srcDirs = []
    sourceSets.main.groovy.srcDirs = ['src/main/java', 'src/main/groovy']

    sourceCompatibility = 1.8

    repositories {
        mavenCentral()
        jcenter()
    }

    dependencies {
        compile lib.groovy_core
    }
}

Project structure:

Whenever I run: $ ./gradlew sonarqube what happens is when it goes through different modules, it does not aggregate sonar reports. It throws in last module scan and overwrites anything that was already stored. So after running this, I just get the results for last modules that gradle executor processed. Can something be done about that?

Upvotes: 0

Views: 444

Answers (1)

Xeperis
Xeperis

Reputation: 1459

For what its worth I solved this issue by applying sonar cube to the root project only:

project(':') {
    apply plugin: 'org.sonarqube'
}

Upvotes: 1

Related Questions