diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/DevModeContext.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/DevModeContext.java index 039ada1dd76a4..fa8e122d382e4 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/dev/DevModeContext.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/dev/DevModeContext.java @@ -312,6 +312,12 @@ public Optional getTest() { return Optional.ofNullable(test); } + public void addSourcePathFirst(String path) { + String absolutePath = Paths.get(path).isAbsolute() ? path + : (projectDirectory + File.separator + path); + this.main.sourcePaths = this.main.sourcePaths.addFirst(Paths.get(absolutePath)); + } + public static class Builder { private ArtifactKey appArtifactKey; diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedDevModeMain.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedDevModeMain.java index 0792198e44625..9a8761cf134d9 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedDevModeMain.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedDevModeMain.java @@ -1,7 +1,6 @@ package io.quarkus.deployment.dev; import static io.quarkus.deployment.dev.testing.MessageFormat.BLUE; -import static java.util.Collections.singleton; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -444,7 +443,7 @@ public boolean test(String s) { module.getSourceParents(), Paths.get(module.getPreBuildOutputDir()), Paths.get(module.getTargetDir()), - sourcePath -> module.addSourcePaths(singleton(sourcePath.toAbsolutePath().toString())))); + sourcePath -> module.addSourcePathFirst(sourcePath.toAbsolutePath().toString()))); } } RuntimeUpdatesProcessor.INSTANCE = setupRuntimeCompilation(context, (Path) params.get(APP_ROOT),