Browse Source

SONARPLUGINS-1220 Runner home must be optional

tags/2.5-rc1
Simon Brandhof 13 years ago
parent
commit
9aa0545336

+ 3
- 0
src/main/assembly/bin/sonar-runner View File

@@ -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 "$@"

+ 4
- 1
src/main/assembly/bin/sonar-runner.bat View File

@@ -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 %*

+ 4
- 5
src/main/java/org/sonar/runner/Main.java View File

@@ -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;
}


Loading…
Cancel
Save