Skip to content

Commit

Permalink
Do not check if debug port can be used in DEV mode on restart
Browse files Browse the repository at this point in the history
fixes quarkusio#28187

(cherry picked from commit fbd35b3)
  • Loading branch information
michalvavrik authored and gsmet committed Oct 17, 2022
1 parent 67ab961 commit c2dd422
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,10 @@ public List<String> args() {
return args;
}

public Boolean getDebugPortOk() {
return debugPortOk;
}

protected abstract boolean isDebugEnabled();

protected void debug(Object msg, Object... args) {
Expand Down
11 changes: 8 additions & 3 deletions devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,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;
Expand Down Expand Up @@ -889,7 +889,11 @@ private class DevModeRunner {
private Process process;

private DevModeRunner() throws Exception {
launcher = newLauncher();
launcher = newLauncher(null);
}

private DevModeRunner(Boolean debugPortOk) throws Exception {
launcher = newLauncher(debugPortOk);
}

Collection<Path> pomFiles() {
Expand Down Expand Up @@ -943,7 +947,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) {
Expand All @@ -962,6 +966,7 @@ private QuarkusDevModeLauncher newLauncher() throws Exception {
.debug(debug)
.debugHost(debugHost)
.debugPort(debugPort)
.debugPortOk(debugPortOk)
.deleteDevJar(deleteDevJar);

setJvmArgs(builder);
Expand Down

0 comments on commit c2dd422

Please sign in to comment.