Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-1817 67de9b94e -> f51981b25


Revert changes which disable signing as well as Jenkins specifc code

Signed-off-by: Alexander Murmann <amurm...@pivotal.io>


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

Branch: refs/heads/feature/GEODE-1817
Commit: f51981b25b1f6eeaacbefd79fb1225b296da2ce1
Parents: 67de9b9
Author: Jens Deppe <jde...@pivotal.io>
Authored: Fri Aug 26 07:55:35 2016 -0700
Committer: Alexander Murmann <amurm...@pivotal.io>
Committed: Fri Aug 26 07:55:35 2016 -0700

----------------------------------------------------------------------
 gradle/publish.gradle | 35 +++++++++++++++++++++++++----------
 1 file changed, 25 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f51981b2/gradle/publish.gradle
----------------------------------------------------------------------
diff --git a/gradle/publish.gradle b/gradle/publish.gradle
index 92f740b..2258da6 100644
--- a/gradle/publish.gradle
+++ b/gradle/publish.gradle
@@ -14,17 +14,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-// This snippet is required so that the root project does not insist on 
needing to be signed.
-gradle.projectsEvaluated { g ->
-  g.rootProject.signing {
-    required { false }
-  }
-}
-
 subprojects {
   apply plugin: 'com.bmuschko.nexus'
-
+  
   extraArchive {
     sources = true
     javadoc = true
@@ -32,7 +24,7 @@ subprojects {
   }
   
   nexus {
-    sign = false
+    sign = true
     repositoryUrl = 
'https://repository.apache.org/service/local/staging/deploy/maven2'
     snapshotRepositoryUrl = 
'https://repository.apache.org/content/repositories/snapshots'
   }
@@ -106,6 +98,29 @@ subprojects {
       }
     }
   }
+  
+  // 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 {
+    if (!isReleaseVersion && System.env.USER == 'jenkins') {
+      def settingsXml = new File(System.getProperty('user.home'), 
'.m2/settings.xml')
+      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()
+            }
+          }
+        }
+      }
+    }
+  }
 }
 
 //Prompt the user for a password to sign archives or upload artifacts, if 
requested

Reply via email to