Repository: quarkusio/quarkus
Issue: Dev mode stops without reason instead of restart when fired by code Changed (worked with 1.4.2.Final)

**Describe the bug**
Problem can be simulated on the example from camel-quarkus: https://github.com/apache/camel-quarkus/tree/master/examples/timer-log

Problem doesn't happen with quarkus **1.4.2.Final**. (but happens with 1.5.0.cr1, 1.5.0.Final and master)

**Expected behavior**
App is reloaded with custom code change.

**Actual behavior**
App stops.


**To Reproduce**
Steps to reproduce the behavior:
1. Download https://github.com/apache/camel-quarkus/tree/master/examples/timer-log (version of quarkus could be chaged in https://github.com/apache/camel-quarkus/blob/master/pom.xml#L69)
2. Run mvn compile quarkus:dev
3. Change message in TimeRoute.java


**Additional context**


Problem seems to be happening somewhere near https://github.com/quarkusio/quarkus/blob/master/core/runtime/src/main/java/io/quarkus/runtime/util/ClassPathUtils.java#L84
I can debug that process enters this method with parameter `META-INF/quarkus-config-roots.list` but it never leaves (no exception is thrown),  Java ends also.
I've tried to debug issue also in https://github.com/quarkusio/quarkus/blob/master/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/classloading/QuarkusClassLoader.java#L154, 
but it usually ens in different places. I'm probably missing something here.


Changed files:
core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedDevModeMain.java

diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedDevModeMain.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedDevModeMain.java
index be15968e689..174d1f4accc 100644
--- a/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedDevModeMain.java
+++ b/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedDevModeMain.java
@@ -12,6 +12,7 @@
 import java.util.Map;
 import java.util.ServiceLoader;
 import java.util.Set;
+import java.util.concurrent.CountDownLatch;
 import java.util.function.BiConsumer;
 import java.util.function.Consumer;
 import java.util.function.Predicate;
@@ -52,6 +53,7 @@ public class IsolatedDevModeMain implements BiConsumer<CuratedApplication, Map<S
     private static volatile AugmentAction augmentAction;
     private static volatile boolean restarting;
     private static volatile boolean firstStartCompleted;
+    private static final CountDownLatch shutdownLatch = new CountDownLatch(1);
 
     private synchronized void firstStart() {
         ClassLoader old = Thread.currentThread().getContextClassLoader();
@@ -228,6 +230,24 @@ public void close() {
     @Override
     public void accept(CuratedApplication o, Map<String, Object> o2) {
         Timing.staticInitStarted(o.getBaseRuntimeClassLoader());
+        //https://github.com/quarkusio/quarkus/issues/9748
+        //if you have an app with all daemon threads then the app thread
+        //may be the only thread keeping the JVM alive
+        //during the restart process when this thread is stopped then
+        //the JVM will die
+        //we start this thread to keep the JVM alive until the shutdown hook is run
+        //even for command mode we still want the JVM to live until it receives
+        //a signal to make the 'press enter to restart' function to work
+        new Thread(new Runnable() {
+            @Override
+            public void run() {
+                try {
+                    shutdownLatch.await();
+                } catch (InterruptedException ignore) {
+
+                }
+            }
+        }, "Quarkus Devmode keep alive thread").start();
         try {
             curatedApplication = o;
 
@@ -282,6 +302,7 @@ public boolean test(String s) {
             Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
                 @Override
                 public void run() {
+                    shutdownLatch.countDown();
                     synchronized (DevModeMain.class) {
                         if (runner != null) {
                             try {