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
  • Loading branch information
michalvavrik authored and igorregis committed Oct 17, 2022
1 parent 4ffa2df commit d63a29e
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 @@ -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;
Expand Down Expand Up @@ -907,7 +907,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 @@ -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) {
Expand All @@ -980,6 +984,7 @@ private QuarkusDevModeLauncher newLauncher() throws Exception {
.debug(debug)
.debugHost(debugHost)
.debugPort(debugPort)
.debugPortOk(debugPortOk)
.deleteDevJar(deleteDevJar);

setJvmArgs(builder);
Expand Down

0 comments on commit d63a29e

Please sign in to comment.