From: Duarte Meneses Date: Mon, 22 Jun 2015 08:53:16 +0000 (+0200) Subject: SONARUNNER-139 Avoid running analysis in forked mode to hang forever X-Git-Tag: 2.5-rc1~79 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b1fabd71e176a5be48fa7b3855d2c13ebf77c6cc;p=sonar-scanner-cli.git SONARUNNER-139 Avoid running analysis in forked mode to hang forever --- diff --git a/sonar-runner-impl/src/main/java/org/sonar/runner/impl/BatchLauncherMain.java b/sonar-runner-impl/src/main/java/org/sonar/runner/impl/BatchLauncherMain.java index 2921742..f41d855 100644 --- a/sonar-runner-impl/src/main/java/org/sonar/runner/impl/BatchLauncherMain.java +++ b/sonar-runner-impl/src/main/java/org/sonar/runner/impl/BatchLauncherMain.java @@ -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); + } } }