]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5408 - Passing SONAR_HOME env to child processes
authorStephane Gamard <stephane.gamard@searchbox.com>
Fri, 11 Jul 2014 09:53:38 +0000 (11:53 +0200)
committerStephane Gamard <stephane.gamard@searchbox.com>
Fri, 11 Jul 2014 09:53:38 +0000 (11:53 +0200)
sonar-start/src/main/java/org/sonar/start/StartServer.java

index fa50ff6003336a939004e245f26dcae58b17dc15..918c1142ae695d2aa7e3dd6e1eaca6fb93f34a78 100644 (file)
@@ -121,7 +121,9 @@ public final class StartServer {
     sonarqube = new ProcessWrapper(
       "org.sonar.application.StartServer",
       new String[]{env.rootDir().getAbsolutePath() + "/lib/server/sonar-application-4.5-SNAPSHOT.jar"},
-      ImmutableMap.of("test", "test"),
+      ImmutableMap.of(
+        "SONAR_HOME", env.rootDir().getAbsolutePath(),
+        "test", "test"),
       "SQ", monitor.getMonitoringPort());
 
     registerProcess(sonarqube);
@@ -132,6 +134,7 @@ public final class StartServer {
       "org.sonar.search.ElasticSearch",
       new String[]{env.rootDir().getAbsolutePath() + "/lib/search/sonar-search-4.5-SNAPSHOT.jar"},
       ImmutableMap.of(
+        "SONAR_HOME", env.rootDir().getAbsolutePath(),
         "esDebug", properties.containsKey("esDebug") ? properties.get("esDebug") : "false",
         "esPort", esPort,
         "esHome", env.rootDir().getAbsolutePath()),
@@ -147,7 +150,6 @@ public final class StartServer {
     //Check if we have a SONAR_HOME
     if (StringUtils.isEmpty(home)) {
       home = new File(".").getAbsolutePath();
-      System.getenv().put("SONAR_HOME", home);
     }
 
     new StartServer(new Env(home), args).start();