summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2011-06-27 09:02:41 +0000
committerSimon Brandhof <simon.brandhof@gmail.com>2011-06-27 09:02:41 +0000
commit9aa05453364c7d7c6946f6e6efbef5d1de01c9e7 (patch)
tree7576329cc54447e0ae37df2f1464e4226b62075a /src
parent9132e3292b142d7dbb5d89cb1973d9e09628bffe (diff)
downloadsonar-scanner-cli-9aa05453364c7d7c6946f6e6efbef5d1de01c9e7.tar.gz
sonar-scanner-cli-9aa05453364c7d7c6946f6e6efbef5d1de01c9e7.zip
SONARPLUGINS-1220 Runner home must be optional
Diffstat (limited to 'src')
-rwxr-xr-xsrc/main/assembly/bin/sonar-runner3
-rw-r--r--src/main/assembly/bin/sonar-runner.bat5
-rw-r--r--src/main/java/org/sonar/runner/Main.java9
3 files changed, 11 insertions, 6 deletions
diff --git a/src/main/assembly/bin/sonar-runner b/src/main/assembly/bin/sonar-runner
index 9193323..16c7eb0 100755
--- a/src/main/assembly/bin/sonar-runner
+++ b/src/main/assembly/bin/sonar-runner
@@ -17,13 +17,16 @@ fi
JAVA_CMD="`which java`"
JAVA_CLASSPATH="${SONAR_RUNNER_HOME}"/lib/sonar-runner.jar:"${SONAR_RUNNER_HOME}"/lib/sonar-batch-bootstrapper.jar
+PROJECT_HOME=`pwd`
#echo "Info: Using sonar-runner at $SONAR_RUNNER_HOME"
#echo "Info: Using java at $JAVACMD"
#echo "Info: Using classpath $JAVACLASSPATH"
+#echo "Info: Using project $PROJECT_HOME"
exec "$JAVA_CMD" \
$SONAR_RUNNER_OPTS \
-classpath $JAVA_CLASSPATH \
"-Drunner.home=${SONAR_RUNNER_HOME}" \
+ "-Dproject.home=${PROJECT_HOME}" \
org.sonar.runner.Main "$@"
diff --git a/src/main/assembly/bin/sonar-runner.bat b/src/main/assembly/bin/sonar-runner.bat
index 4635e80..8be6542 100644
--- a/src/main/assembly/bin/sonar-runner.bat
+++ b/src/main/assembly/bin/sonar-runner.bat
@@ -14,4 +14,7 @@ set SONAR_RUNNER_HOME=%~dp0..
:run
echo %SONAR_RUNNER_HOME%
-"%JAVA_HOME%\bin\java.exe" %SONAR_RUNNER_OPTS% -classpath "%SONAR_RUNNER_HOME%\lib\sonar-runner.jar";"%SONAR_RUNNER_HOME%\lib\sonar-batch-bootstrapper.jar" "-Drunner.home=%SONAR_RUNNER_HOME%" org.sonar.runner.Main %*
+
+set PROJECT_HOME=%CD%
+
+"%JAVA_HOME%\bin\java.exe" %SONAR_RUNNER_OPTS% -classpath "%SONAR_RUNNER_HOME%\lib\sonar-runner.jar";"%SONAR_RUNNER_HOME%\lib\sonar-batch-bootstrapper.jar" "-Drunner.home=%SONAR_RUNNER_HOME%" "-Dproject.home=%PROJECT_HOME%" org.sonar.runner.Main %*
diff --git a/src/main/java/org/sonar/runner/Main.java b/src/main/java/org/sonar/runner/Main.java
index f935d5f..1eb8b77 100644
--- a/src/main/java/org/sonar/runner/Main.java
+++ b/src/main/java/org/sonar/runner/Main.java
@@ -51,11 +51,10 @@ public final class Main {
}
static Properties loadProperties(String[] args) {
- Properties props = new Properties();
- Properties commandLineProps = parseArguments(args);
- props.putAll(loadRunnerProperties(commandLineProps));
- props.putAll(loadProjectProperties(commandLineProps));
- props.putAll(commandLineProps);
+ Properties props = parseArguments(args);
+ props.putAll(System.getProperties());
+ props.putAll(loadRunnerProperties(props));
+ props.putAll(loadProjectProperties(props));
return props;
}