aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2016-08-15 14:20:49 +0200
committerDuarte Meneses <duarte.meneses@sonarsource.com>2016-08-15 14:20:49 +0200
commit4e62271c74a2346ba9d8d42d16916874a0fde5bc (patch)
tree636d5e42579766f92a5d7ba41efa3cc5755e7aca /src
parentbc49ddf6f68e7b80dabad80c77e9db4bcb548f83 (diff)
downloadsonar-scanner-cli-4e62271c74a2346ba9d8d42d16916874a0fde5bc.tar.gz
sonar-scanner-cli-4e62271c74a2346ba9d8d42d16916874a0fde5bc.zip
SQSCANNER-26 Support SONARQUBE_SCANNER_PARAMS and sonar.scanner.skip
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/sonarsource/scanner/cli/Conf.java29
1 files changed, 2 insertions, 27 deletions
diff --git a/src/main/java/org/sonarsource/scanner/cli/Conf.java b/src/main/java/org/sonarsource/scanner/cli/Conf.java
index 7907030..c224204 100644
--- a/src/main/java/org/sonarsource/scanner/cli/Conf.java
+++ b/src/main/java/org/sonarsource/scanner/cli/Conf.java
@@ -27,15 +27,11 @@ import java.nio.file.Path;
import java.nio.file.Paths;
import java.text.MessageFormat;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
-import com.eclipsesource.json.Json;
-import com.eclipsesource.json.JsonObject;
-import com.eclipsesource.json.JsonObject.Member;
-import com.eclipsesource.json.JsonValue;
+import org.sonarsource.scanner.api.Utils;
class Conf {
private static final String SCANNER_HOME = "scanner.home";
@@ -46,7 +42,6 @@ class Conf {
private static final String PROPERTY_PROJECT_BASEDIR = "sonar.projectBaseDir";
private static final String PROPERTY_PROJECT_CONFIG_FILE = "sonar.projectConfigFile";
private static final String SONAR_PROJECT_PROPERTIES_FILENAME = "sonar-project.properties";
- private static final String SONARQUBE_SCANNER_PARAMS = "SONARQUBE_SCANNER_PARAMS";
private final Cli cli;
private final Logs logger;
@@ -72,27 +67,7 @@ class Conf {
}
private Properties loadEnvironmentProperties() {
- Properties props = new Properties();
-
- String scannerParams = env.get(SONARQUBE_SCANNER_PARAMS);
- if (scannerParams != null) {
- try {
-
- JsonValue jsonValue = Json.parse(scannerParams);
- JsonObject jsonObject = jsonValue.asObject();
- Iterator<Member> it = jsonObject.iterator();
-
- while (it.hasNext()) {
- Member member = it.next();
- String key = member.getName();
- String value = member.getValue().asString();
- props.put(key, value);
- }
- } catch (Exception e) {
- throw new IllegalStateException("Failed to parse JSON in SONARQUBE_SCANNER_PARAMS environment variable", e);
- }
- }
- return props;
+ return Utils.loadEnvironmentProperties(env);
}
private Properties loadGlobalProperties() throws IOException {