Sonar Gradle Plugin 2.8
SonarQube 6.7.6 (Community Edition)
Sonar Scanner 4.2
I’ve been working on trying to get the sonarqube gradle task to scan our gradle project that is structured as a “composite” build using the “includeBuild” statements at the top level build (settings.gradle). We had to go to composite build to support our project which is basically a group of multi-project gradle builds that we release at the same time. What I’m seeing is that the sonarqube task cannot see anything included in the build through the “includeBuild” feature for creating composite builds, so I’m unable to scan the entire project tree in one go. If I create a sonarscan task that calls the other builds sonarqube task, I only receive one scan in the server because each build overwrites the previous builds sonar scan resuls, so the last one to run is what is visible on the server.
What does work is running a pure command-line scan with sonar-scanner and sonar-project.properties strategically located throughout the project so that I can scan eveything in one shot. So, I at least know that this is possible. We would like it to work correctly through gradle, so we don’t have to maintain a separate program install for the scanner and allow the gradle plugin to maintain our scanner version and blend in with our toolchain.
Is what I’m trying to do possible with the sonarqube gradle plugin?