]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4898 - Using NetworkUtils for ES port selection
authorStephane Gamard <stephane.gamard@searchbox.com>
Thu, 10 Jul 2014 22:57:25 +0000 (00:57 +0200)
committerStephane Gamard <stephane.gamard@searchbox.com>
Thu, 10 Jul 2014 22:57:25 +0000 (00:57 +0200)
sonar-start/src/main/java/org/sonar/start/StartServer.java

index 997b5269c6f48ccd23925e462a133619a6f72dc2..77c06ed8441e9df993da3f1c6cd1f7bf112f9b97 100644 (file)
@@ -52,13 +52,15 @@ public final class StartServer {
     final ExecutorService executor = Executors.newFixedThreadPool(2);
     final MonitorService monitor = new MonitorService(systemAvailableSocket());
 
+    final String esPort = Integer.toString(NetworkUtils.freePort());
+
     //Create the processes
     //final ProcessWrapper sonarQube = new ProcessWrapper("SQ", monitor);
     final ProcessWrapper elasticsearch = new ProcessWrapper(
       "org.sonar.search.ElasticSearch",
       new String[]{env.rootDir().getAbsolutePath() + "/lib/search/sonar-search-4.5-SNAPSHOT.jar"},
       ImmutableMap.of(
-        "esPort", Integer.toString(NetworkUtils.freePort()),
+        "esPort",esPort,
         "esHome", env.rootDir().getAbsolutePath()),
       "ES", monitor.getMonitoringPort());