From 49dd31bd994792ba062693c7d434ef38377ce452 Mon Sep 17 00:00:00 2001 From: Andy Damevin Date: Thu, 2 Dec 2021 16:06:10 +0100 Subject: [PATCH] Fix bug with mavenSettings in WrapperRunner while running tests locally --- .../main/java/io/quarkus/devtools/testing/WrapperRunner.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/independent-projects/tools/devtools-testing/src/main/java/io/quarkus/devtools/testing/WrapperRunner.java b/independent-projects/tools/devtools-testing/src/main/java/io/quarkus/devtools/testing/WrapperRunner.java index fb5f16eb025df..f503b72eb5c00 100644 --- a/independent-projects/tools/devtools-testing/src/main/java/io/quarkus/devtools/testing/WrapperRunner.java +++ b/independent-projects/tools/devtools-testing/src/main/java/io/quarkus/devtools/testing/WrapperRunner.java @@ -9,7 +9,9 @@ import java.io.PrintStream; import java.io.UncheckedIOException; import java.nio.charset.StandardCharsets; +import java.nio.file.Files; import java.nio.file.Path; +import java.nio.file.Paths; import java.util.Arrays; import java.util.LinkedList; import java.util.List; @@ -105,7 +107,7 @@ public static int run(Path projectDir, Wrapper wrapper) { private static String getMavenSettingsArg() { final String mavenSettings = System.getProperty("maven.settings"); if (mavenSettings != null) { - return mavenSettings; + return Files.exists(Paths.get(mavenSettings)) ? mavenSettings : null; } return BootstrapMavenOptions.newInstance().getOptionValue(BootstrapMavenOptions.ALTERNATE_USER_SETTINGS); }