diff --git a/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/console/ConfigEditorProcessor.java b/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/console/ConfigEditorProcessor.java index 2fd3187372802..2ad89389cf35b 100644 --- a/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/console/ConfigEditorProcessor.java +++ b/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/console/ConfigEditorProcessor.java @@ -15,7 +15,6 @@ import org.eclipse.microprofile.config.Config; import org.eclipse.microprofile.config.ConfigProvider; -import org.jboss.logging.Logger; import io.quarkus.deployment.annotations.BuildStep; import io.quarkus.deployment.builditem.ConfigDescriptionBuildItem; @@ -28,8 +27,6 @@ public class ConfigEditorProcessor { - private static final Logger log = Logger.getLogger(ConfigEditorProcessor.class); - @BuildStep DevConsoleTemplateInfoBuildItem config(List config) throws Exception { List configs = new ArrayList<>(); @@ -86,6 +83,14 @@ protected void handlePost(RoutingContext event, MultiMap form) throws Exception appProperties.load(in); present = appProperties.containsKey(key); } + } else { + // If there is no application.properties file then create a new one in the first module + List resourcesDir = DevConsoleManager.getHotReplacementContext().getResourcesDir(); + if (resourcesDir.isEmpty()) { + throw new IllegalStateException( + "Unable to create application.properties - no resource directory found"); + } + appProps = Files.createFile(resourcesDir.get(0).resolve("application.properties")); } if (!present) { try (OutputStream out = Files.newOutputStream(appProps, StandardOpenOption.APPEND)) {