diff --git a/gradle/artifactory.gradle b/gradle/artifactory.gradle index ab3381e1..8d3de17d 100644 --- a/gradle/artifactory.gradle +++ b/gradle/artifactory.gradle @@ -1,12 +1,18 @@ apply plugin: "com.jfrog.artifactory" def isSnapshot = version?.endsWith("-SNAPSHOT") +def isMilestone = version?.matches('^.*[.-]M\\d+$') || version?.matches('^.*[.-]RC\\d+$') artifactory { contextUrl = 'https://repo.spring.io' publish { repository { - repoKey = isSnapshot ? 'libs-snapshot-local' : 'libs-release-local' + repoKey = 'libs-release-local' + if (isSnapshot) { + repoKey = 'libs-snapshot-local' + } else if (isMilestone) { + repoKey = 'libs-milestone-local' + } if(project.hasProperty('artifactoryUsername')) { username = artifactoryUsername password = artifactoryPassword diff --git a/gradle/deploy-artifacts.gradle b/gradle/deploy-artifacts.gradle index 09785bc9..f9479cf7 100644 --- a/gradle/deploy-artifacts.gradle +++ b/gradle/deploy-artifacts.gradle @@ -1,11 +1,13 @@ def isSnapshot = version?.endsWith("-SNAPSHOT") +def isMilestone = version?.matches('^.*[.-]M\\d+$') || version?.matches('^.*[.-]RC\\d+$') +def isRelease = !(isSnapshot || isMilestone) task deployArtifacts { group = 'Deploy tasks' description = "Deploys the artifacts to either Artifactory or Maven Central" - if(isSnapshot) { - dependsOn "artifactoryPublish" - } else { + if(isRelease) { dependsOn "uploadArchives" + } else { + dependsOn "artifactoryPublish" } } diff --git a/gradle/finalize-deploy.gradle b/gradle/finalize-deploy.gradle index 6b64fb05..bbd4014f 100644 --- a/gradle/finalize-deploy.gradle +++ b/gradle/finalize-deploy.gradle @@ -1,5 +1,6 @@ def isSnapshot = version?.endsWith("-SNAPSHOT") -def isRelease = !isSnapshot +def isMilestone = version?.matches('^.*[.-]M\\d+$') || version?.matches('^.*[.-]RC\\d+$') +def isRelease = !(isSnapshot || isMilestone) task finalizeDeployArtifacts { } diff --git a/gradle/ossrh.gradle b/gradle/ossrh.gradle index adf8f4be..656557dc 100644 --- a/gradle/ossrh.gradle +++ b/gradle/ossrh.gradle @@ -1,5 +1,6 @@ def isSnapshot = version?.endsWith("-SNAPSHOT") -def isRelease = !isSnapshot +def isMilestone = version?.matches('^.*[.-]M\\d+$') || version?.matches('^.*[.-]RC\\d+$') +def isRelease = !(isSnapshot || isMilestone) if(project.hasProperty("signing.keyId") && isRelease) { apply plugin: "signing"