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/25 21:40:07 UTC

[2/2] incubator-geode git commit: GEODE-781: Check for existence of settings.xml

GEODE-781: Check for existence of settings.xml

If the jenkins user does not have a settings.xml file the build
will fail.  This adds a check to only read values from the file
if it is present on the filesystem.


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/42dd4a79
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/42dd4a79
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/42dd4a79

Branch: refs/heads/develop
Commit: 42dd4a79b8e2e60e9d05fd065c63da2247b86d5c
Parents: ed31351
Author: Anthony Baker <ab...@apache.org>
Authored: Mon Jan 25 11:40:38 2016 -0800
Committer: Anthony Baker <ab...@apache.org>
Committed: Mon Jan 25 12:38:58 2016 -0800

----------------------------------------------------------------------
 build.gradle | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/42dd4a79/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 4222275..28519dd 100755
--- a/build.gradle
+++ b/build.gradle
@@ -557,15 +557,17 @@ subprojects {
   afterEvaluate {
     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()
+      if (settingsXml.exists()) {
+        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()
+            }
           }
         }
       }