diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2013-01-15 14:09:02 +0100 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2013-01-15 14:09:02 +0100 |
commit | a791d08d1c0934d77be820b0a12660080b38b5f2 (patch) | |
tree | 1b71c0d592e4ecaabbf9bbad9815f6c0a52385de /src/main/java | |
parent | 89efe41a15713e2368ab3b3fe4dabc9505cf83ee (diff) | |
download | sonar-scanner-cli-a791d08d1c0934d77be820b0a12660080b38b5f2.tar.gz sonar-scanner-cli-a791d08d1c0934d77be820b0a12660080b38b5f2.zip |
SONARPLUGINS-2571 Do not parse configuration files when using --version
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/sonar/runner/Main.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/main/java/org/sonar/runner/Main.java b/src/main/java/org/sonar/runner/Main.java index 5321345..698ab3e 100644 --- a/src/main/java/org/sonar/runner/Main.java +++ b/src/main/java/org/sonar/runner/Main.java @@ -69,12 +69,16 @@ public final class Main { private void execute(String[] args) { Stats stats = new Stats().start(); try { - loadProperties(args); - Runner runner = Runner.create(command, globalProperties, projectProperties); + Properties argsProperties = parseArguments(args); Logs.info("Runner version: " + Version.getVersion()); Logs.info("Java version: " + System.getProperty("java.version", "<unknown>") + ", vendor: " + System.getProperty("java.vendor", "<unknown>")); Logs.info("OS name: \"" + System.getProperty("os.name") + "\", version: \"" + System.getProperty("os.version") + "\", arch: \"" + System.getProperty("os.arch") + "\""); + if (displayVersionOnly) { + return; + } + loadProperties(argsProperties); + Runner runner = Runner.create(command, globalProperties, projectProperties); Logs.info("Default locale: \"" + Locale.getDefault() + "\", source code encoding: \"" + runner.getSourceCodeEncoding() + "\"" + (runner.isEncodingPlatformDependant() ? " (analysis is platform dependent)" : "")); if (debugMode) { @@ -87,9 +91,6 @@ public final class Main { } catch (IOException e) { throw new RunnerException(e); } - if (displayVersionOnly) { - return; - } runner.execute(); } finally { stats.stop(); @@ -97,8 +98,7 @@ public final class Main { } @VisibleForTesting - void loadProperties(String[] args) { - Properties argsProperties = parseArguments(args); + void loadProperties(Properties argsProperties) { globalProperties = loadGlobalProperties(argsProperties); projectProperties = loadProjectProperties(argsProperties); } |