diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-08-04 19:21:48 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-08-04 19:22:34 +0200 |
commit | cb17205416bdd17cdfc02324dae27edebce7cb65 (patch) | |
tree | 8eef8d23f96f81c1263bab49b42f7e7df2dee514 /sonar-application | |
parent | 385b24540e849cad17284cc2ebe62de0ec90db87 (diff) | |
download | sonarqube-cb17205416bdd17cdfc02324dae27edebce7cb65.tar.gz sonarqube-cb17205416bdd17cdfc02324dae27edebce7cb65.zip |
SONAR-4898 accept system properties starting with "sonar."
Diffstat (limited to 'sonar-application')
-rw-r--r-- | sonar-application/src/main/java/org/sonar/application/Installation.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sonar-application/src/main/java/org/sonar/application/Installation.java b/sonar-application/src/main/java/org/sonar/application/Installation.java index 8dafc704400..3326fd01c80 100644 --- a/sonar-application/src/main/java/org/sonar/application/Installation.java +++ b/sonar-application/src/main/java/org/sonar/application/Installation.java @@ -34,6 +34,7 @@ import java.io.File; import java.io.FileReader; import java.io.IOException; import java.net.URISyntaxException; +import java.util.Map; import java.util.Properties; public class Installation { @@ -149,7 +150,17 @@ public class Installation { } static Installation parseArguments(String[] args) throws Exception { - return new Installation(argumentsToProperties(args)); + Properties props = argumentsToProperties(args); + + // complete with only the system properties that start with "sonar." + for (Map.Entry<Object, Object> entry : System.getProperties().entrySet()) { + String key = entry.getKey().toString(); + if (key.startsWith("sonar.")) { + props.setProperty(key, entry.getValue().toString()); + } + } + + return new Installation(props); } static Properties argumentsToProperties(String[] args) { |