diff --git a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusTask.java b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusTask.java index 3294472909fb1..e8dade749dc72 100644 --- a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusTask.java +++ b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusTask.java @@ -61,9 +61,14 @@ WorkQueue workQueue(Map configMap, Supplier configMap, List> customizations) { JavaForkOptions forkOptions = processWorkerSpec.getForkOptions(); - customizations.forEach(a -> a.execute(forkOptions)); + // Propagate user.dir to load config sources that use it (instead of the worker user.dir) + String userDir = configMap.get("user.dir"); + if (userDir != null) { + forkOptions.systemProperty("user.dir", userDir); + } + String quarkusWorkerMaxHeap = System.getProperty("quarkus.gradle-worker.max-heap"); if (quarkusWorkerMaxHeap != null && forkOptions.getAllJvmArgs().stream().noneMatch(arg -> arg.startsWith("-Xmx"))) { forkOptions.jvmArgs("-Xmx" + quarkusWorkerMaxHeap);