Settings set via build gradle not reflected in Sonarqube UI

Configured SonarQube properties in 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"

Properties in file

    # Sonar Configuration


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 file it started working.

  1. Do we have any rule like some properties should be set only via or command line but not in build gradle. ?
  2. To be more specific the value “MyprojectName” in ["property “sonar.projectName”, “MyprojectName” ] build.gradle sonnar setting is not reflected in Sonar UI(version:sonarqube- Default project name value is displayed in UI.


I’m not aware of any rules for Gradle or any of the other scanners about what can’t be set in the global file. Only what shouldn’t.


Alright. I am going with this sonar docs and it works.

But its still grey area ,why if we move the sonar settings from to build.gradle it does’t worked?.

Thanks Ann ,much appreciated for your time.


I really think that’s going to end up being a Gradle thing & I don’t have the background there to help.