From 2a1f0c7b4a62ea177925db906a0166a76c7555bc Mon Sep 17 00:00:00 2001 From: Mark Vieira Date: Mon, 12 Aug 2019 13:24:18 -0700 Subject: [PATCH] Fix location of reaper jar on Windows (#45464) (cherry picked from commit 5021c5d8bf815ed11a2fe9cf4d3a2c2ed2e2e0b3) --- .../main/java/org/elasticsearch/gradle/ReaperService.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/ReaperService.java b/buildSrc/src/main/java/org/elasticsearch/gradle/ReaperService.java index 01339448028..596b1ca12db 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/ReaperService.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/ReaperService.java @@ -142,7 +142,13 @@ public class ReaperService { Matcher matcher = REAPER_JAR_PATH_PATTERN.matcher(mainPath); if (matcher.matches()) { - return Path.of(matcher.group(1)); + String path = matcher.group(1); + return Path.of( + OS.conditional() + .onWindows(() -> path.substring(1)) + .onUnix(() -> path) + .supply() + ); } else { throw new RuntimeException("Unable to locate " + REAPER_CLASS + " on build classpath."); }