You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ab...@apache.org on 2016/02/06 19:07:39 UTC
[10/15] incubator-geode git commit: GEODE-781: Remove the
maven-publish-auth plugin
GEODE-781: Remove the maven-publish-auth plugin
Read the settings.xml file directly when build is run by Jenkins.
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/e5a7b9aa
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/e5a7b9aa
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/e5a7b9aa
Branch: refs/heads/develop
Commit: e5a7b9aaa82d4c0a04e41febfd515056c4669001
Parents: f06a43f
Author: Anthony Baker <ab...@apache.org>
Authored: Sat Jan 16 09:14:14 2016 -0800
Committer: Anthony Baker <ab...@apache.org>
Committed: Sat Jan 16 09:36:14 2016 -0800
----------------------------------------------------------------------
build.gradle | 23 +++++++++++++++++------
1 file changed, 17 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e5a7b9aa/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 90d4a60..85e5c35 100755
--- a/build.gradle
+++ b/build.gradle
@@ -24,7 +24,6 @@ buildscript {
classpath "gradle.plugin.org.nosphere.apache:creadur-rat-gradle:0.2.0"
classpath "org.ajoberstar:gradle-git:1.3.2"
classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1'
- classpath 'org.hibernate.build.gradle:gradle-maven-publish-auth:2.0.1'
}
}
@@ -517,12 +516,24 @@ subprojects {
}
}
- // Jenkins stores auth information in settings.xml. We apply the maven-publish-auth plugin to read that
- // from gradle. However, we must match the repository id which the nexus plugin is not exposing.
- apply plugin: 'maven-publish-auth'
+ // The nexus plugin reads authentication from ~/.gradle/gradle.properties but the
+ // jenkins server stores publishing credentials in ~/.m2/settings.xml (maven).
+ // We match on the expected snapshot repository id.
afterEvaluate {
- tasks.getByName('uploadArchives').doFirst {
- repositories.each { it.snapshotRepository.id = 'apache.snapshots.https' }
+ if (!isReleaseVersion && System.env.USER == 'jenkins') {
+ def settingsXml = new File(System.getProperty('user.home'), '.m2/settings.xml')
+ def snapshotCreds = new XmlSlurper().parse(settingsXml).servers.server.find { server ->
+ server.id.text() == 'apache.snapshots.https'
+ }
+
+ if (snapshotCreds != null) {
+ tasks.uploadArchives.doFirst {
+ repositories().withType(MavenDeployer).each { repo ->
+ repo.snapshotRepository.authentication.userName = snapshotCreds.username.text()
+ repo.snapshotRepository.authentication.password = snapshotCreds.password.text()
+ }
+ }
+ }
}
}