Configured SonarQube properties in gradle.properties files for my spring boot project and SonarQube analysis is working fine(able to verify in portal). But when it tried to add some more property in build.gradle, it is not reflecting in sonar portal .
For exmaple in build.gradle added these sonar property , which is not reflecting in sonar portal–>
plugins {
id 'java'
id 'org.springframework.boot' version '2.2.7.RELEASE'
id 'gradle-boost' version '2.1.0'
id 'maven-publish'
id 'jacoco'
id 'org.sonarqube' version '2.7'
}
sonarqube {
properties {
property "sonar.projectName", "MyprojectName"
property "sonar.projectDescription", "MyprojectDescription"
}
}
It’s not clear to me which properties aren’t working.
That said, project key isn’t something you should set in a global file; that should only be set at the project level or even on the analysis command line.
I tired by setting all properties in build.gradle (file in root folder) which did’t worked.
When i moved all the properties setting to gradle.properties file it started working.
Do we have any rule like some properties should be set only via gradle.properties or command line but not in build gradle. ?
To be more specific the value “MyprojectName” in ["property “sonar.projectName”, “MyprojectName” ] build.gradle sonnar setting is not reflected in Sonar UI(version:sonarqube-8.3.1.34397). Default project name value is displayed in UI.