Repository: quarkusio/quarkus
Issue: remote-dev is not taking into account HotDeploymentWatchedFileBuildItem

The paths configured with HotDeploymentWatchedFileBuildItem (including e.g. `application.properties`) aren't supported in remote-dev.
Here's a quick hack to add support for picking up changes to the `application.properties`:
```
diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedRemoteDevModeMain.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedRemoteDevModeMain.java
index 630ffb6dc0..5b838a13db 100644
--- a/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedRemoteDevModeMain.java
+++ b/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedRemoteDevModeMain.java
@@ -131,6 +131,7 @@ public class IsolatedRemoteDevModeMain implements BiConsumer<CuratedApplication,
                             copiedStaticResources.computeIfAbsent(moduleInfo, ss -> new HashSet<>()).add(s);
                         }
                     });
+            processor.setWatchedFilePaths(Collections.singletonMap("application.properties", Boolean.TRUE));
```

FYI @stuartwdouglas 

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

diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/HotDeploymentConfigFileBuildStep.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/HotDeploymentConfigFileBuildStep.java
index e227702fecd..73b555246a5 100644
--- a/core/deployment/src/main/java/io/quarkus/deployment/dev/HotDeploymentConfigFileBuildStep.java
+++ b/core/deployment/src/main/java/io/quarkus/deployment/dev/HotDeploymentConfigFileBuildStep.java
@@ -13,7 +13,7 @@ public class HotDeploymentConfigFileBuildStep {
     @BuildStep
     ServiceStartBuildItem setupConfigFileHotDeployment(List<HotDeploymentWatchedFileBuildItem> files) {
         // TODO: this should really be an output of the RuntimeRunner
-        RuntimeUpdatesProcessor processor = IsolatedDevModeMain.runtimeUpdatesProcessor;
+        RuntimeUpdatesProcessor processor = RuntimeUpdatesProcessor.INSTANCE;
         if (processor != null) {
             Map<String, Boolean> watchedFilePaths = files.stream()
                     .collect(Collectors.toMap(HotDeploymentWatchedFileBuildItem::getLocation,
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 31215563d06..a25fb322bc8 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
@@ -58,7 +58,6 @@ public class IsolatedDevModeMain implements BiConsumer<CuratedApplication, Map<S
     private final List<HotReplacementSetup> hotReplacementSetups = new ArrayList<>();
     private static volatile RunningQuarkusApplication runner;
     static volatile Throwable deploymentProblem;
-    static volatile RuntimeUpdatesProcessor runtimeUpdatesProcessor;
     private static volatile CuratedApplication curatedApplication;
     private static volatile AugmentAction augmentAction;
     private static volatile boolean restarting;
@@ -95,8 +94,8 @@ public void accept(Integer integer) {
                                         System.in.read();
                                     }
                                     System.out.println("Restarting...");
-                                    runtimeUpdatesProcessor.checkForChangedClasses();
-                                    restartApp(runtimeUpdatesProcessor.checkForFileChange());
+                                    RuntimeUpdatesProcessor.INSTANCE.checkForChangedClasses();
+                                    restartApp(RuntimeUpdatesProcessor.INSTANCE.checkForFileChange());
                                 } catch (Exception e) {
                                     log.error("Failed to restart", e);
                                 }
@@ -117,7 +116,7 @@ public void accept(Integer integer) {
                     //we need to set this here, while we still have the correct TCCL
                     //this is so the config is still valid, and we can read HTTP config from application.properties
                     log.info("Attempting to start hot replacement endpoint to recover from previous Quarkus startup failure");
-                    if (runtimeUpdatesProcessor != null) {
+                    if (RuntimeUpdatesProcessor.INSTANCE != null) {
                         Thread.currentThread().setContextClassLoader(curatedApplication.getBaseRuntimeClassLoader());
 
                         try {
@@ -126,7 +125,7 @@ public void accept(Integer integer) {
                                         .loadClass(LoggingSetupRecorder.class.getName());
                                 cl.getMethod("handleFailedStart").invoke(null);
                             }
-                            runtimeUpdatesProcessor.startupFailed();
+                            RuntimeUpdatesProcessor.INSTANCE.startupFailed();
                         } catch (Exception e) {
                             close();
                             log.error("Failed to recover after failed start", e);
@@ -253,7 +252,7 @@ public void close() {
         } finally {
             try {
                 try {
-                    runtimeUpdatesProcessor.close();
+                    RuntimeUpdatesProcessor.INSTANCE.close();
                 } catch (IOException e) {
                     log.error("Failed to close compiler", e);
                 }
@@ -340,19 +339,20 @@ public boolean test(String s) {
                                     sourcePath -> module.addSourcePaths(singleton(sourcePath.toAbsolutePath().toString()))));
                 }
             }
-            runtimeUpdatesProcessor = setupRuntimeCompilation(context, (Path) params.get(APP_ROOT),
+            RuntimeUpdatesProcessor.INSTANCE = setupRuntimeCompilation(context, (Path) params.get(APP_ROOT),
                     (DevModeType) params.get(DevModeType.class.getName()));
-            if (runtimeUpdatesProcessor != null) {
-                runtimeUpdatesProcessor.checkForFileChange();
-                runtimeUpdatesProcessor.checkForChangedClasses();
+            if (RuntimeUpdatesProcessor.INSTANCE != null) {
+                RuntimeUpdatesProcessor.INSTANCE.checkForFileChange();
+                RuntimeUpdatesProcessor.INSTANCE.checkForChangedClasses();
             }
             firstStart(deploymentClassLoader, codeGens);
 
             //        doStart(false, Collections.emptySet());
-            if (deploymentProblem != null || runtimeUpdatesProcessor.getCompileProblem() != null) {
+            if (deploymentProblem != null || RuntimeUpdatesProcessor.INSTANCE.getCompileProblem() != null) {
                 if (context.isAbortOnFailedStart()) {
                     throw new RuntimeException(
-                            deploymentProblem == null ? runtimeUpdatesProcessor.getCompileProblem() : deploymentProblem);
+                            deploymentProblem == null ? RuntimeUpdatesProcessor.INSTANCE.getCompileProblem()
+                                    : deploymentProblem);
                 }
             }
             Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedRemoteDevModeMain.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedRemoteDevModeMain.java
index 630ffb6dc03..150fc33a6c5 100644
--- a/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedRemoteDevModeMain.java
+++ b/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedRemoteDevModeMain.java
@@ -56,7 +56,6 @@ public class IsolatedRemoteDevModeMain implements BiConsumer<CuratedApplication,
 
     private final List<HotReplacementSetup> hotReplacementSetups = new ArrayList<>();
     static volatile Throwable deploymentProblem;
-    static volatile RuntimeUpdatesProcessor runtimeUpdatesProcessor;
     static volatile RemoteDevClient remoteDevClient;
     static volatile Closeable remoteDevClientSession;
     private static volatile CuratedApplication curatedApplication;
@@ -150,7 +149,7 @@ void regenerateApplication(Set<String> ignore) {
     public void close() {
         try {
             try {
-                runtimeUpdatesProcessor.close();
+                RuntimeUpdatesProcessor.INSTANCE.close();
             } catch (IOException e) {
                 log.error("Failed to close compiler", e);
             }
@@ -190,11 +189,11 @@ public void accept(CuratedApplication o, Map<String, Object> o2) {
             }
 
             augmentAction = new AugmentActionImpl(curatedApplication);
-            runtimeUpdatesProcessor = setupRuntimeCompilation(context, appRoot);
+            RuntimeUpdatesProcessor.INSTANCE = setupRuntimeCompilation(context, appRoot);
 
-            if (runtimeUpdatesProcessor != null) {
-                runtimeUpdatesProcessor.checkForFileChange();
-                runtimeUpdatesProcessor.checkForChangedClasses();
+            if (RuntimeUpdatesProcessor.INSTANCE != null) {
+                RuntimeUpdatesProcessor.INSTANCE.checkForFileChange();
+                RuntimeUpdatesProcessor.INSTANCE.checkForChangedClasses();
             }
 
             JarResult result = generateApplication();
@@ -254,7 +253,7 @@ private RemoteDevClient.SyncResult runSync() {
         Set<String> removed = new HashSet<>();
         Map<String, byte[]> changed = new HashMap<>();
         try {
-            boolean scanResult = runtimeUpdatesProcessor.doScan(true);
+            boolean scanResult = RuntimeUpdatesProcessor.INSTANCE.doScan(true);
             if (!scanResult && !copiedStaticResources.isEmpty()) {
                 scanResult = true;
                 regenerateApplication(Collections.emptySet());
@@ -291,7 +290,7 @@ public Set<String> getRemovedFiles() {
 
             @Override
             public Throwable getProblem() {
-                return runtimeUpdatesProcessor.getDeploymentProblem();
+                return RuntimeUpdatesProcessor.INSTANCE.getDeploymentProblem();
             }
 
         };
diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/RuntimeUpdatesProcessor.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/RuntimeUpdatesProcessor.java
index ff9c291504e..35d68bca123 100644
--- a/core/deployment/src/main/java/io/quarkus/deployment/dev/RuntimeUpdatesProcessor.java
+++ b/core/deployment/src/main/java/io/quarkus/deployment/dev/RuntimeUpdatesProcessor.java
@@ -43,6 +43,7 @@ public class RuntimeUpdatesProcessor implements HotReplacementContext, Closeable
     private static final Logger log = Logger.getLogger(RuntimeUpdatesProcessor.class);
 
     private static final String CLASS_EXTENSION = ".class";
+    static volatile RuntimeUpdatesProcessor INSTANCE;
 
     private final Path applicationRoot;
     private final DevModeContext context;