aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-application
diff options
context:
space:
mode:
authorJacek <jacek.poreda@sonarsource.com>2021-11-24 16:49:01 +0100
committersonartech <sonartech@sonarsource.com>2021-11-25 20:03:17 +0000
commit810e5b045586a6e4584aa219cc7f03a80497e562 (patch)
treedac4c90a02a6176765c5f915afd6277d4c05a0f5 /sonar-application
parent134af4f77dd413a3dfa321ed60f8f951e03911d3 (diff)
downloadsonarqube-810e5b045586a6e4584aa219cc7f03a80497e562.tar.gz
sonarqube-810e5b045586a6e4584aa219cc7f03a80497e562.zip
SONAR-15690 Add check for default configuration in sonar.properties file
Diffstat (limited to 'sonar-application')
-rw-r--r--sonar-application/build.gradle13
1 files changed, 13 insertions, 0 deletions
diff --git a/sonar-application/build.gradle b/sonar-application/build.gradle
index 2a70c75b0a4..9cbb3c7f3fa 100644
--- a/sonar-application/build.gradle
+++ b/sonar-application/build.gradle
@@ -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'