Skip to content

Commit

Permalink
Better ignore blank wrapperUri when determining whether to use existi…
Browse files Browse the repository at this point in the history
…ng Gradle wrapper URI (#4407)
  • Loading branch information
jkschneider authored Aug 12, 2024
1 parent eeb43a8 commit b2ed163
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private GradleWrapper getGradleWrapper(ExecutionContext ctx) {
throw new IllegalArgumentException(
"wrapperUri contains a ${version} interpolation specifier but no version parameter was specified.", e);
}
if(!version.matches("[0-9.]+")) {
if (!version.matches("[0-9.]+")) {
throw new IllegalArgumentException(
"Version selectors like \"" + version + "\" are unavailable when services.gradle.org cannot be reached. " +
"Specify an exact, literal version number.", e);
Expand Down Expand Up @@ -472,7 +472,7 @@ public Properties visitEntry(Properties.Entry entry, ExecutionContext ctx) {
String currentUrl = value.getText();
// Prefer wrapperUri specified directly in the recipe over other options
// If that isn't set, prefer the existing artifact repository URL over changing to services.gradle.org
if (wrapperUri != null) {
if (!StringUtils.isBlank(wrapperUri)) {
String effectiveWrapperUri = formatUriForPropertiesFile(wrapperUri
.replace("${version}", gradleWrapper.getVersion())
.replace("${distribution}", distribution == null ? "bin" : distribution));
Expand Down

0 comments on commit b2ed163

Please sign in to comment.