I have a project with the following structure in gradle (root project, sub-project1 and sub-project2 are sub-project each with their own build.gradle)
- root project
- sub-project1
build.gradle - sub-project2
build.gradle
-build.gradle
-settings.gradle
- sub-project1
I have a sonar analysis setup such that it analyzes the whole project into a project root-analysis
on sonarqube. It works ok
With the sub-project1
sub-project growing bigger, I wish to transfer its analysis into a separate sonarqube project sub-project1-analysis
and remove it from the root-project-analysis
. Is there a way to do so?
And I’ve tried.
- In root build.gradle, sonar configuration
plugins {
-
id ‘org.sonarqube’ version ‘3.2.0’*
-
}*
-
apply plugin: 'org.sonarqube'*
in root settings.gradle,
rootProject.name = ‘root-project’ -
include ":sub-project1"*
-
include ":sub-project2"*
- In sub-project1 build.gradle ,add these configuration:
apply plugin: “org.sonarqube”
-
sonarqube {*
-
properties {*
-
// Insert other SonarQube properties here*
-
property 'sonar.projectName', 'sub-project1'*
-
property 'sonar.projectKey', 'sub-project1-analysis'*
-
}*
-
}*
In the terminal , I type the command " gradle clean :sub-project1:sonarqube -Dsonar.host.url=*** -Dsonar.login=**** "
It popups error " * What went wrong: Task ‘sonarqube’ not found in project ‘:sub-project1’. "
I’m currently using sonar-gradle plugin 3.2.0
, and it’d be great if I didn’t have to update that.
Thanks!