SonarQube integration with gradle

Refresh

April 2019

Views

523 time

1

I am integrating Sonar qube with gradle. I have mentioned plugin and required properties in app level build.gradle file.But command execution failed with exception. Please clarify what else required?

Build.gradle :

        plugins {
                id "org.sonarqube" version "2.6.1"
                }
      sonarqube {
                properties {
                property "sonar.host.url", "http://192.168.22.12:9000/"
                property "sonar.projectName", "ourValues-Android"
                property "sonar.projectKey", "1234567"
                property "sonar.projectVersion","8.0"
                property "sonar.sources","src/main/java"
                property "sonar.exclusions","build/**,**/*.png"
                property "sonar.sourceEncoding", "UTF-8"
                property "sonar.report.export.path", "sonar-report.json"
                property "sonar.issuesReport.json.enable", "true"
                property "sonar.import_unknown_files", true
                property "sonar.android.lint.report", "./build/outputs/lint-
                results.xml"
                }
              }

Exception is when running command gradlew sonarqube :

Execution failed for task ':app:sonarqube'. You must define the following mandatory properties for 'Unknown': sonar.projectKey, sonar.sources

Please check the structure of project...

Structure Of Project

0 answers