Skip to content

Commit

Permalink
Merge pull request #28624 from aaronrebak/bugfix/resolve-gradlemodelf…
Browse files Browse the repository at this point in the history
…actory-gradleuserhome-misconfiguration

Resolve gradle user home misconfiguration
  • Loading branch information
aloubyansky committed Oct 17, 2022
2 parents 5df6480 + c4757f5 commit 4c76723
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -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;

Expand All @@ -19,6 +20,7 @@ public static ApplicationModel create(File projectDir, String mode, String... ta
public static ApplicationModel create(File projectDir, String mode, List<String> 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();
}
Expand All @@ -27,6 +29,7 @@ public static ApplicationModel create(File projectDir, String mode, List<String>
public static ApplicationModel createForTasks(File projectDir, String... tasks) {
try (ProjectConnection connection = GradleConnector.newConnector()
.forProjectDirectory(projectDir)
.useGradleUserHomeDir(GradleUserHomeLookup.gradleUserHome())
.connect()) {
final ModelBuilder<ApplicationModel> modelBuilder = connection.model(ApplicationModel.class);
if (tasks.length != 0) {
Expand Down

0 comments on commit 4c76723

Please sign in to comment.