From 820c671ddd80b656a6bd227db9f3112531c97c67 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 23 Jan 2020 11:55:42 +0000 Subject: [PATCH] Configure repositories based on the version that is being built https://repo.spring.io/snapshot should only be available when building a BUILD-SNAPSHOT. https://repo.spring.io/milestone should only be available when not building a RELEASE (a BUILD-SNAPSHOT, Mn, or RCn). Closes gh-19700 --- build.gradle | 8 ++++++-- settings.gradle | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 3abde44406..1e8b94cf9b 100644 --- a/build.gradle +++ b/build.gradle @@ -9,8 +9,12 @@ allprojects { repositories { mavenCentral() - maven { url "https://repo.spring.io/milestone" } - maven { url "https://repo.spring.io/snapshot" } + if (!version.endsWith('RELEASE')) { + maven { url "https://repo.spring.io/milestone" } + } + if (version.endsWith('BUILD-SNAPSHOT')) { + maven { url "https://repo.spring.io/snapshot" } + } } configurations.all { diff --git a/settings.gradle b/settings.gradle index ab3c1f67cf..5671c837f1 100644 --- a/settings.gradle +++ b/settings.gradle @@ -2,7 +2,9 @@ pluginManagement { repositories { mavenCentral() gradlePluginPortal() - maven { url "https://repo.spring.io/snapshot" } + if (version.endsWith('BUILD-SNAPSHOT')) { + maven { url "https://repo.spring.io/snapshot" } + } } resolutionStrategy { eachPlugin {