Skip to content

Commit 6706512

Browse files
committed
Pull most recent Structure101 version
Closes gh-10696
1 parent 525f404 commit 6706512

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

buildSrc/src/main/java/s101/S101Configurer.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,18 @@ private String installBuildTool(File installationDirectory, File configurationDi
164164
String source = "https://structure101.com/binaries/19159";
165165
try (final WebClient webClient = new WebClient()) {
166166
HtmlPage page = webClient.getPage(source);
167+
Matcher matcher = null;
167168
for (HtmlAnchor anchor : page.getAnchors()) {
168-
Matcher matcher = Pattern.compile("(structure101-build-java-all-)(.*).zip").matcher(anchor.getHrefAttribute());
169-
if (matcher.find()) {
170-
copyZipToFilesystem(source, installationDirectory, matcher.group(1) + matcher.group(2));
171-
return matcher.group(2);
169+
Matcher candidate = Pattern.compile("(structure101-build-java-all-)(.*).zip").matcher(anchor.getHrefAttribute());
170+
if (candidate.find()) {
171+
matcher = candidate;
172172
}
173173
}
174-
return null;
174+
if (matcher == null) {
175+
return null;
176+
}
177+
copyZipToFilesystem(source, installationDirectory, matcher.group(1) + matcher.group(2));
178+
return matcher.group(2);
175179
} catch (Exception ex) {
176180
throw new RuntimeException(ex);
177181
}

0 commit comments

Comments
 (0)