]> source.dussan.org Git - sonar-scanner-cli.git/commitdiff
SONARUNNER-139 Avoid running analysis in forked mode to hang forever
authorDuarte Meneses <duarte.meneses@sonarsource.com>
Mon, 22 Jun 2015 08:53:16 +0000 (10:53 +0200)
committerDuarte Meneses <duarte.meneses@sonarsource.com>
Mon, 22 Jun 2015 08:53:16 +0000 (10:53 +0200)
sonar-runner-impl/src/main/java/org/sonar/runner/impl/BatchLauncherMain.java

index 2921742a3260938e77684618467ce3da89c3f04d..f41d855e2b70e02d7de40db0cfdd8925c5e511b6 100644 (file)
@@ -43,7 +43,7 @@ public class BatchLauncherMain {
     try {
       launcher.execute(props);
     } finally {
-      //persistit has non-daemon threads that need to be stopped or the jvm w'ont quit
+      // try to still exit cleanly
       launcher.stop();
     }
   }
@@ -59,7 +59,13 @@ public class BatchLauncherMain {
     return props;
   }
 
-  public static void main(String[] args) throws IOException {
-    new BatchLauncherMain(new IsolatedLauncherFactory()).execute(args);
+  public static void main(String[] args) {
+    try {
+      new BatchLauncherMain(new IsolatedLauncherFactory()).execute(args);
+    } catch (Exception e) {
+      e.printStackTrace(System.err);
+      // make sure non-daemon threads don't hang app
+      System.exit(1);
+    }
   }
 }