From f3a45e95c8a863a49ca15c6a4367e63b33bd0186 Mon Sep 17 00:00:00 2001 From: Roberto Cortez Date: Wed, 21 Feb 2024 20:25:13 +0000 Subject: [PATCH] Propagate user.dir to Gradle worker --- .../src/main/java/io/quarkus/gradle/tasks/QuarkusTask.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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);