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/01/16 18:22:38 UTC

incubator-geode git commit: GEODE-781: Remove the maven-publish-auth plugin

Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-781 09508b445 -> 5e9916d31


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/5e9916d3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/5e9916d3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/5e9916d3

Branch: refs/heads/feature/GEODE-781
Commit: 5e9916d317a56da545671d5ed6050b53bda813d3
Parents: 09508b4
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:20:26 2016 -0800

----------------------------------------------------------------------
 build.gradle | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/5e9916d3/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index e651fd9..3163cf7 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'
   }
 }
 
@@ -530,12 +529,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()
+          }
+        }
+      }
     }
   }