From 37b416cfa8576df86eb4cb4d4fada5e44fa4702c Mon Sep 17 00:00:00 2001 From: John Blum Date: Thu, 20 Jan 2022 21:30:10 -0800 Subject: [PATCH] Refactor the SBDG Gradle build script. Declare the Spring plugins-release repository in buildscript. Add authentication (credentials) to the Spring plugins-snapshot repository declaration in buildscript. Redefined the snapshotBuild, milestoneBuild and releaseBuild project extensions properties in terms of the Utils Groovy class from Spring Build Conventions Gradle Plugins. --- build.gradle | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 676c931c..43ef90b9 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,19 @@ +import io.spring.gradle.convention.Utils + buildscript { repositories { + mavenCentral() gradlePluginPortal() - maven { url 'https://repo.spring.io/plugins-snapshot' } + maven { url 'https://repo.spring.io/plugins-release' } + maven { + url 'https://repo.spring.io/plugins-snapshot' + if (project.hasProperty('artifactoryUsername')) { + credentials { + username "$artifactoryUsername" + password "$artifactoryPassword" + } + } + } } dependencies { classpath 'io.spring.gradle:spring-build-conventions:0.0.38' @@ -43,8 +55,8 @@ description = 'Spring Boot for Apache Geode' //ext['spring-data-bom.version'] = "$springDataBomVersion" //ext['spring-session-bom.version'] = "$springSessionBomVersion" -ext.snapshotBuild = version.endsWith('SNAPSHOT') -ext.releaseBuild = version.endsWith('RELEASE') -ext.milestoneBuild = !(releaseBuild || snapshotBuild) +ext.snapshotBuild = Utils.isSnapshot(project) +ext.milestoneBuild = Utils.isMilestone(project) +ext.releaseBuild = Utils.isRelease(project) ext.MAVEN_POM_EDITOR_GRADLE = "$rootDir/gradle/maven-pom-editor.gradle"