diff --git a/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/console/DevConsoleProcessor.java b/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/console/DevConsoleProcessor.java index 7b938559bb256..7623f175110d1 100644 --- a/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/console/DevConsoleProcessor.java +++ b/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/console/DevConsoleProcessor.java @@ -305,21 +305,37 @@ public ServiceStartBuildItem setupDeploymentSideHandling(List routes, - BuildProducer routeBuildItemBuildProducer, - LogStreamRecorder recorder, + public void setupDevConsoleRoutes( + DevConsoleRecorder recorder, + LogStreamRecorder logStreamRecorder, + List routes, CurateOutcomeBuildItem curateOutcomeBuildItem, HistoryHandlerBuildItem historyHandlerBuildItem, NonApplicationRootPathBuildItem nonApplicationRootPathBuildItem, - LaunchModeBuildItem launchModeBuildItem) { + LaunchModeBuildItem launchModeBuildItem, + ShutdownContextBuildItem shutdownContext, + BuildProducer routeBuildItemBuildProducer) throws IOException { if (launchModeBuildItem.getDevModeType().orElse(null) != DevModeType.LOCAL) { return; } + // Add the static resources + AppArtifact devConsoleResourcesArtifact = WebJarUtil.getAppArtifact(curateOutcomeBuildItem, "io.quarkus", + "quarkus-vertx-http-deployment"); + + Path devConsoleStaticResourcesDeploymentPath = WebJarUtil.copyResourcesForDevOrTest(curateOutcomeBuildItem, + launchModeBuildItem, + devConsoleResourcesArtifact, STATIC_RESOURCES_PATH); + + routeBuildItemBuildProducer.produce(nonApplicationRootPathBuildItem.routeBuilder() + .route("dev/resources/*") + .handler(recorder.devConsoleHandler(devConsoleStaticResourcesDeploymentPath.toString(), shutdownContext)) + .build()); + // Add the log stream routeBuildItemBuildProducer.produce(nonApplicationRootPathBuildItem.routeBuilder() .route("dev/logstream") - .handler(recorder.websocketHandler(historyHandlerBuildItem.value)) + .handler(logStreamRecorder.websocketHandler(historyHandlerBuildItem.value)) .build()); for (DevConsoleRouteBuildItem i : routes) { @@ -349,29 +365,6 @@ public void setupDevConsoleRoutes(List routes, .build()); } - @BuildStep(onlyIf = IsDevelopment.class) - @Record(ExecutionTime.RUNTIME_INIT) - public void deployStaticResources(DevConsoleRecorder recorder, CurateOutcomeBuildItem curateOutcomeBuildItem, - LaunchModeBuildItem launchMode, ShutdownContextBuildItem shutdownContext, - BuildProducer routeBuildItemBuildProducer, - NonApplicationRootPathBuildItem nonApplicationRootPathBuildItem, - LaunchModeBuildItem launchModeBuildItem) throws IOException { - - if (launchModeBuildItem.getDevModeType().orElse(DevModeType.LOCAL) != DevModeType.LOCAL) { - return; - } - AppArtifact devConsoleResourcesArtifact = WebJarUtil.getAppArtifact(curateOutcomeBuildItem, "io.quarkus", - "quarkus-vertx-http-deployment"); - - Path devConsoleStaticResourcesDeploymentPath = WebJarUtil.copyResourcesForDevOrTest(curateOutcomeBuildItem, launchMode, - devConsoleResourcesArtifact, STATIC_RESOURCES_PATH); - - routeBuildItemBuildProducer.produce(nonApplicationRootPathBuildItem.routeBuilder() - .route("dev/resources/*") - .handler(recorder.devConsoleHandler(devConsoleStaticResourcesDeploymentPath.toString(), shutdownContext)) - .build()); - } - private Engine buildEngine(List devTemplatePaths, List allRoutes, NonApplicationRootPathBuildItem nonApplicationRootPathBuildItem) {