aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-application/src
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2014-07-30 17:19:03 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2014-07-30 17:19:03 +0200
commit019079b710f70ce19a449c0d6d209ecc2569a00a (patch)
tree73a57d45fd91860d1a3d469b04a7f188b64caabd /sonar-application/src
parent374db617e2618defd69ab7b571f40a093b8f515d (diff)
downloadsonarqube-019079b710f70ce19a449c0d6d209ecc2569a00a.tar.gz
sonarqube-019079b710f70ce19a449c0d6d209ecc2569a00a.zip
SONAR-4898 set exit code
Diffstat (limited to 'sonar-application/src')
-rw-r--r--sonar-application/src/main/java/org/sonar/application/App.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/sonar-application/src/main/java/org/sonar/application/App.java b/sonar-application/src/main/java/org/sonar/application/App.java
index 642884d5cf4..daf1e53c205 100644
--- a/sonar-application/src/main/java/org/sonar/application/App.java
+++ b/sonar-application/src/main/java/org/sonar/application/App.java
@@ -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);
}
}