diff --git a/independent-projects/bootstrap/gradle-resolver/src/main/java/io/quarkus/bootstrap/resolver/QuarkusGradleModelFactory.java b/independent-projects/bootstrap/gradle-resolver/src/main/java/io/quarkus/bootstrap/resolver/QuarkusGradleModelFactory.java index 6c42d1f260ffa..6177ef610942f 100644 --- a/independent-projects/bootstrap/gradle-resolver/src/main/java/io/quarkus/bootstrap/resolver/QuarkusGradleModelFactory.java +++ b/independent-projects/bootstrap/gradle-resolver/src/main/java/io/quarkus/bootstrap/resolver/QuarkusGradleModelFactory.java @@ -7,6 +7,7 @@ import org.gradle.tooling.GradleConnector; import org.gradle.tooling.ModelBuilder; import org.gradle.tooling.ProjectConnection; +import org.gradle.wrapper.GradleUserHomeLookup; import io.quarkus.bootstrap.model.ApplicationModel; @@ -19,6 +20,7 @@ public static ApplicationModel create(File projectDir, String mode, String... ta public static ApplicationModel create(File projectDir, String mode, List jvmArgs, String... tasks) { try (ProjectConnection connection = GradleConnector.newConnector() .forProjectDirectory(projectDir) + .useGradleUserHomeDir(GradleUserHomeLookup.gradleUserHome()) .connect()) { return connection.action(new QuarkusModelBuildAction(mode)).forTasks(tasks).addJvmArguments(jvmArgs).run(); } @@ -27,6 +29,7 @@ public static ApplicationModel create(File projectDir, String mode, List public static ApplicationModel createForTasks(File projectDir, String... tasks) { try (ProjectConnection connection = GradleConnector.newConnector() .forProjectDirectory(projectDir) + .useGradleUserHomeDir(GradleUserHomeLookup.gradleUserHome()) .connect()) { final ModelBuilder modelBuilder = connection.model(ApplicationModel.class); if (tasks.length != 0) {