Skip to content

Commit

Permalink
Configure repositories based on the version that is being built
Browse files Browse the repository at this point in the history
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 spring-projectsgh-19700
  • Loading branch information
wilkinsona committed Jan 23, 2020
1 parent 01a0a54 commit 820c671
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 6 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 3 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 820c671

Please sign in to comment.