Browse Source

SONAR-15690 Add check for default configuration in sonar.properties file

tags/9.3.0.51899
Jacek 2 years ago
parent
commit
810e5b0455
1 changed files with 13 additions and 0 deletions
  1. 13
    0
      sonar-application/build.gradle

+ 13
- 0
sonar-application/build.gradle View File

@@ -74,6 +74,19 @@ dependencies {
// declare dependencies in configuration bundledPlugin to be packaged in lib/extensions
apply from: 'bundled_plugins.gradle'

//verify if sonar.properties files does not have any external input
task verifySonarProperties(type: Verify) {
def propertiesFile = file('src/main/assembly/conf/sonar.properties')
propertiesFile.withReader { reader ->
def line
while ((line = reader.readLine()) != null) {
if (!line.startsWith('#') && !line.isEmpty()) {
throw new GradleException('sonar.properties file by default must not provide any user configuration.')
}
}
}
}

task verifyElasticSearchDownload(type: Verify) {
src new File(buildDir, "$elasticsearchDownloadUrlFile")
algorithm 'SHA-512'

Loading…
Cancel
Save