Skip to content

Commit 14344c9

Browse files
committed
fix: mvn binary in windows
Signed-off-by: Ruben Romero Montes <rromerom@redhat.com>
1 parent 5f0a68c commit 14344c9

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/main/java/com/redhat/exhort/providers/JavaMavenProvider.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ public int hashCode() {
377377
private String selectMvnRuntime(final Path manifestPath) {
378378
boolean preferWrapper = Operations.getWrapperPreference(MVN);
379379
if (preferWrapper) {
380-
String wrapperName = isWindows() ? "mvnw.cmd" : "mvnw";
380+
String wrapperName = Operations.isWindows() ? "mvnw.cmd" : "mvnw";
381381
String mvnw = traverseForMvnw(wrapperName, manifestPath.toString());
382382
if (mvnw != null) {
383383
try {
@@ -428,13 +428,9 @@ public static String traverseForMvnw(
428428
public static String normalizePath(String thePath) {
429429
Path normalized = Paths.get(thePath).toAbsolutePath().normalize();
430430
String result = normalized.toString();
431-
if (isWindows()) {
431+
if (Operations.isWindows()) {
432432
result = result.toLowerCase();
433433
}
434434
return result;
435435
}
436-
437-
private static boolean isWindows() {
438-
return System.getProperty("os.name").toLowerCase().contains("win");
439-
}
440436
}

src/main/java/com/redhat/exhort/tools/Operations.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,4 +349,8 @@ public static Optional<String> getGitRootDir(String cwd) {
349349
}
350350
return Optional.empty();
351351
}
352+
353+
public static boolean isWindows() {
354+
return System.getProperty("os.name").toLowerCase().contains("win");
355+
}
352356
}

0 commit comments

Comments
 (0)