Deploying maven and gradle plugins to libs-snapshot-local

This commit is contained in:
Marcin Grzejszczak
2016-07-25 12:48:05 +02:00
parent d6ced5a0c6
commit 8f9856d0f2
2 changed files with 18 additions and 25 deletions

View File

@@ -1,11 +1,6 @@
apply plugin: 'maven'
apply plugin: 'signing'
ext {
isReleaseVersion = version.endsWith("RELEASE")
isMilestoneVersion = version.matches('[0-9].[0-9].[0-9].M[0-9]+') || version.matches('[0-9].[0-9].[0-9].RC[0-9]+')
}
uploadArchives.dependsOn { [check] }
task sourcesJar(type: Jar) {
@@ -30,9 +25,24 @@ artifacts {
}
ext {
repositoryUrl = "https://repo.spring.io/plugins-release-local"
snapshotRepositoryUrl = "https://repo.spring.io/plugins-snapshot-local"
repoUrl = (isReleaseVersion || isMilestoneVersion) ? repositoryUrl : snapshotRepositoryUrl
resolveRepoName = { Project project ->
resolvedRepoName = "libs-${resolveVersion(project.version)}-local"
logger.lifecycle("For project [$project.name] with " +
"version [$project.version] the resolved Artifactory repo is [$resolvedRepoName]")
return resolvedRepoName
}
isReleaseVersion = version.endsWith("RELEASE")
isMilestoneVersion = version.matches('[0-9].[0-9].[0-9].M[0-9]+') || version.matches('[0-9].[0-9].[0-9].RC[0-9]+')
isSnapshotVersion = !(isReleaseVersion || isMilestoneVersion)
resolveVersion = { String version ->
if (isMilestoneVersion) return 'milestone'
if (isReleaseVersion) return 'release'
return 'snapshot'
}
repoUrl = "https://repo.spring.io/${resolveRepoName(project)}"
}
afterEvaluate {

View File

@@ -34,23 +34,6 @@
<inceptionYear>2016</inceptionYear>
<distributionManagement>
<repository>
<id>repo.spring.io</id>
<name>Spring Release Repository</name>
<url>https://repo.spring.io/plugins-release-local</url>
</repository>
<snapshotRepository>
<id>repo.spring.io</id>
<name>Spring Snapshot Repository</name>
<url>https://repo.spring.io/plugins-snapshot-local</url>
</snapshotRepository>
<site>
<id>github</id>
<url>scm:git:git@github.com:spring-cloud/spring-cloud-contract.git</url>
</site>
</distributionManagement>
<build>
<plugins>
<plugin>