diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/QuarkusDevModeLauncher.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/QuarkusDevModeLauncher.java index a6140046945b4..ff6c918d803ee 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/dev/QuarkusDevModeLauncher.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/dev/QuarkusDevModeLauncher.java @@ -494,6 +494,10 @@ public List args() { return args; } + public Boolean getDebugPortOk() { + return debugPortOk; + } + protected abstract boolean isDebugEnabled(); protected void debug(Object msg, Object... args) { diff --git a/devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java b/devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java index 0d300ecc92a9d..70c1875fb8b5c 100644 --- a/devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java +++ b/devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java @@ -447,7 +447,7 @@ public void execute() throws MojoFailureException, MojoExecutionException { try { triggerCompile(false, false); triggerCompile(true, false); - newRunner = new DevModeRunner(); + newRunner = new DevModeRunner(runner.launcher.getDebugPortOk()); } catch (Exception e) { getLog().info("Could not load changed pom.xml file, changes not applied", e); continue; @@ -907,7 +907,11 @@ private class DevModeRunner { private Process process; private DevModeRunner() throws Exception { - launcher = newLauncher(); + launcher = newLauncher(null); + } + + public DevModeRunner(Boolean debugPortOk) throws Exception { + launcher = newLauncher(debugPortOk); } Collection pomFiles() { @@ -961,7 +965,7 @@ void stop() throws InterruptedException { } } - private QuarkusDevModeLauncher newLauncher() throws Exception { + private QuarkusDevModeLauncher newLauncher(Boolean debugPortOk) throws Exception { String java = null; // See if a toolchain is configured if (toolchainManager != null) { @@ -980,6 +984,7 @@ private QuarkusDevModeLauncher newLauncher() throws Exception { .debug(debug) .debugHost(debugHost) .debugPort(debugPort) + .debugPortOk(debugPortOk) .deleteDevJar(deleteDevJar); setJvmArgs(builder);