]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4898 set exit code
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Wed, 30 Jul 2014 15:19:03 +0000 (17:19 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Wed, 30 Jul 2014 15:19:03 +0000 (17:19 +0200)
sonar-application/src/main/java/org/sonar/application/App.java

index 642884d5cf4b318618d5a844ec48a4a6c61c2106..daf1e53c20500bb51aa28d8167340146f58c6c89 100644 (file)
@@ -34,6 +34,7 @@ public class App implements ProcessMXBean {
   private Monitor monitor = new Monitor();
   private ProcessWrapper elasticsearch;
   private ProcessWrapper server;
+  private boolean success = false;
 
   public App(Installation installation) throws Exception {
     this.installation = installation;
@@ -79,6 +80,7 @@ public class App implements ProcessMXBean {
           if (server.execute()) {
             monitor.registerProcess(server);
             if (server.waitForReady()) {
+              success = true;
               logger.info("Web server is ready");
               monitor.join();
             }
@@ -118,11 +120,15 @@ public class App implements ProcessMXBean {
     }
   }
 
+  private boolean isSuccess() {
+    return success;
+  }
+
   public static void main(String[] args) throws Exception {
     Installation installation = new Installation();
     new AppLogging().configure(installation);
     App app = new App(installation);
     app.start();
-    System.exit(0);
+    System.exit(app.isSuccess() ? 0 : 1);
   }
 }