We have version 6.5 (build 27846) of SonarQube running in our CI environment. I have some files in my Gradle-based java project, for which I would like to disable "duplicate code detection". According to the docs under [1], I can set a property called "sonar.cpd.exclusions" for this. I configured our build.gradle as follows:
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'org.sonarqube'
apply plugin: 'org.owasp.dependencycheck'
...
sonarqube {
properties {
property "sonar.projectKey", "<our project key>"
property "sonar.projectName", "<our project name>"
property "sonar.branch", branchName
property "sonar.sourceEncoding", "UTF-8"
property "sonar.exclusions", "**/*.css,**/*.js"
property "sonar.cpd.exclusions", "<our path>/*.java"
}
}
When I run a gradle build, it looks as if the "sonar.cpd.exclusions" property is not overriding default settings. Classes in that directory still get analyzed for duplicate code. What did I do wrong here? We run latest plugins on Sonar.