Disabling SCM in sonar.properties doesn't work

12,348

If you're building your project with Gradle, you can use the property sonar.scm.disabled.

For example, set it in your build.gradle:

// Let SonarQube analyze the project
sonarqube {
    properties {
        property "sonar.projectKey", "YourProjectId"

        property "sonar.projectName", "Your Project"

        property "sonar.sourceEncoding", "UTF-8"

        // For SVN projects, SonarQube would run "svn blame" to know
        // who changed which parts of the code. Without authorization
        // this fails, so we disable it
        property "sonar.scm.disabled", "True"

        // Address of the SonarQube server
        property "sonar.host.url", "localhost:9000"
    }
}

You can also pass the property via the command line to Gradle:

./gradlew sonarqube -Dsonar.scm.disabled=True
Share:
12,348
mangobowl
Author by

mangobowl

Updated on June 12, 2022

Comments

  • mangobowl
    mangobowl almost 2 years

    It seems that adding sonar.scm.disabled=true to the conf doesn't not work. The sonar-scanner will report the following error:

    ERROR: Error during SonarQube Scanner execution java.lang.IllegalStateException: Error when executing blame for file betamao/betamao/admin.py at org.sonar.plugins.scm.svn.SvnBlameCommand.blame(SvnBlameCommand.java:86) at org.sonar.plugins.scm.svn.SvnBlameCommand.blame(SvnBlameCommand.java:59) at org.sonar.batch.scm.ScmSensor.execute(ScmSensor.java:86) at org.sonar.batch.sensor.SensorWrapper.analyse(SensorWrapper.java:57) at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:58) ...

    I still have to disable SCM in "General Settings > SCM" administration page to make it work.

    Is this a bug?

    My environment is:

    sonar-scanner 3.0.3.778 with openjdk8-u131

    sonarqube-5.6.6lts with openjdk8-u131