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:38:28 UTC

[1/4] incubator-geode git commit: GEODE-781: Another nexus / Jenkins fix for uploading artifacts

Repository: incubator-geode
Updated Branches:
  refs/heads/develop 2d815d87f -> d863b6eab


GEODE-781: Another nexus / Jenkins fix for uploading artifacts


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

Branch: refs/heads/develop
Commit: ed38c5d0cf78be902f398d45695d15b3f9ac7d9f
Parents: 0f651c0
Author: Anthony Baker <ab...@apache.org>
Authored: Fri Jan 15 11:36:34 2016 -0800
Committer: Anthony Baker <ab...@apache.org>
Committed: Sat Jan 16 09:38:02 2016 -0800

----------------------------------------------------------------------
 build.gradle | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ed38c5d0/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 524fe00..e651fd9 100755
--- a/build.gradle
+++ b/build.gradle
@@ -534,10 +534,8 @@ subprojects {
   // from gradle.  However, we must match the repository id which the nexus plugin is not exposing.
   apply plugin: 'maven-publish-auth'
   afterEvaluate {
-    tasks.getByName('uploadArchives').repositories.mavenDeployer() {
-      if (project.nexus.snapshotRepositoryUrl) {
-        repository(id: 'apache.snapshots.https', url: project.nexus.snapshotRepositoryUrl)
-      }
+    tasks.getByName('uploadArchives').doFirst {
+      repositories.each { it.snapshotRepository.id = 'apache.snapshots.https' }
     }
   }
 


[4/4] incubator-geode git commit: GEODE-781: Remove the maven-publish-auth plugin

Posted by ab...@apache.org.
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/d863b6ea
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/d863b6ea
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/d863b6ea

Branch: refs/heads/develop
Commit: d863b6eabce26bec24da60527fa1d4affac9f82d
Parents: ed38c5d
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:38:03 2016 -0800

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


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d863b6ea/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()
+          }
+        }
+      }
     }
   }
 


[2/4] incubator-geode git commit: GEODE-781: Match repository id to allow Jenkins to upload Maven artifacts

Posted by ab...@apache.org.
GEODE-781: Match repository id to allow Jenkins to upload Maven artifacts


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

Branch: refs/heads/develop
Commit: 0f651c06fe20c4b9f26ed5e76be3ffb2dc8e863a
Parents: 6b61d49
Author: Anthony Baker <ab...@apache.org>
Authored: Fri Jan 15 11:07:11 2016 -0800
Committer: Anthony Baker <ab...@apache.org>
Committed: Sat Jan 16 09:38:02 2016 -0800

----------------------------------------------------------------------
 build.gradle | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0f651c06/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 9160839..524fe00 100755
--- a/build.gradle
+++ b/build.gradle
@@ -488,7 +488,6 @@ subprojects {
 
   // publishing configuration
   apply plugin: 'com.bmuschko.nexus'
-  apply plugin: 'maven-publish-auth'
   
   extraArchive {
     sources = true
@@ -531,6 +530,17 @@ 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'
+  afterEvaluate {
+    tasks.getByName('uploadArchives').repositories.mavenDeployer() {
+      if (project.nexus.snapshotRepositoryUrl) {
+        repository(id: 'apache.snapshots.https', url: project.nexus.snapshotRepositoryUrl)
+      }
+    }
+  }
+
   // Make precheckin task run all validation tests for checking in code.
   task precheckin (dependsOn: [ build, integrationTest, distributedTest ]) {
     description 'Run this task before checking in code to validate changes. This task combines the following tasks: build, integrationTest, and distributedTest'
@@ -548,4 +558,3 @@ subprojects {
   // Make sure clean task for rootProject runs last
   clean.finalizedBy rootProject.clean
 }
-


[3/4] incubator-geode git commit: GEODE-781: Update maven publishing to include signatures

Posted by ab...@apache.org.
GEODE-781: Update maven publishing to include signatures

The maven-publish plugin does not grok signature nor sign pom
files.  These are needed for publishing release versions on Maven
Central.  Switching over to the nexus plugin simplified signing,
generation of javadoc / sources jars, and publishing.

To publish to the local maven repository (~/.m2/repository):
  gradle install

To publish to the snapshot / release repositories:
  gradle uploadArtifacts

Signatures will only be created if the following properties are set
in ~/.gradle.properties:
  signing.keyId
  signing.secretKeyRingFile
  signing.password

To upload the artifacts to Maven, you will need to set the following
properties in ~/.gradle/gradle.properties:
  nexusUsername
  nexusPassword


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

Branch: refs/heads/develop
Commit: 6b61d49266e074fec60c11ad08662bd81abbe345
Parents: 2d815d8
Author: Anthony Baker <ab...@apache.org>
Authored: Thu Jan 14 14:47:59 2016 -0800
Committer: Anthony Baker <ab...@apache.org>
Committed: Sat Jan 16 09:38:02 2016 -0800

----------------------------------------------------------------------
 build.gradle                          |  75 +++++++++++-------
 gemfire-assembly/build.gradle         | 119 +++++------------------------
 gemfire-core/build.gradle             |   4 -
 gemfire-web-api/build.gradle          |   4 -
 gemfire-web/build.gradle              |   4 -
 gradle/dependency-versions.properties |   3 -
 6 files changed, 68 insertions(+), 141 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6b61d492/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 352594e..9160839 100755
--- a/build.gradle
+++ b/build.gradle
@@ -17,13 +17,14 @@
 
 buildscript {
   repositories {
-    maven {
-      url "https://plugins.gradle.org/m2/"
-    }
+    maven { url "https://plugins.gradle.org/m2/" }
   }
+
   dependencies {
     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'
   }
 }
 
@@ -110,17 +111,6 @@ gradle.taskGraph.whenReady({ graph ->
 
 subprojects {
   apply plugin: 'java'
-  apply plugin: 'signing'
-
-  // set these properties in ~/.gradle/gradle.properties file: 
-  // signing.keyId
-  // signing.password
-  // signing.secretKeyRingFile
-  if (isReleaseVersion) {
-    signing {
-      sign configurations.archives
-    }
-  }
 
   // apply compiler options
   gradle.taskGraph.whenReady( { graph ->
@@ -309,20 +299,8 @@ subprojects {
     classifier 'test'
   }
 
-  task sourcesJar(type: Jar, dependsOn: classes) {
-    classifier = 'sources'
-    from sourceSets.main.allSource
-  }
-
-  task javadocJar(type: Jar, dependsOn: javadoc) {
-    description 'Assembles a jar archive of javadocs.'
-    from javadoc.destinationDir
-    classifier = 'javadoc'
-  }
-
   artifacts {
     testOutput jarTest
-    archives sourcesJar, javadocJar
   }
 
   sourceSets {
@@ -508,6 +486,51 @@ subprojects {
     }
   })
 
+  // publishing configuration
+  apply plugin: 'com.bmuschko.nexus'
+  apply plugin: 'maven-publish-auth'
+  
+  extraArchive {
+    sources = true
+    javadoc = true
+    tests = false
+  }
+
+  nexus {
+    sign = true
+    repositoryUrl = 'https://repository.apache.org/service/local/staging/deploy/maven2'
+    snapshotRepositoryUrl = 'https://repository.apache.org/content/repositories/snapshots'
+  }
+  
+  modifyPom {
+    project {
+      name 'Apache Geode (incubating)'
+      description 'Apache Geode (incubating) provides a database-like consistency model, reliable transaction processing and a shared-nothing architecture to maintain very low latency performance with high concurrency processing'
+      url 'http://geode.incubator.apache.org'
+
+      scm {
+        url 'https://git-wip-us.apache.org/repos/asf?p=incubator-geode.git;a=tree'
+        connection 'scm:https://git-wip-us.apache.org/repos/asf/incubator-geode.git'
+        developerConnection 'scm:https://git-wip-us.apache.org/repos/asf/incubator-geode.git'
+      }
+
+      licenses {
+        license {
+          name 'The Apache Software License, Version 2.0'
+          url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+        }
+      }
+
+      repositories {
+        repository {
+          id 'libs-release'
+          name 'Spring Maven libs-release Repository'
+          url 'http://repo.spring.io/libs-release'
+        }
+      }
+    }
+  }
+
   // Make precheckin task run all validation tests for checking in code.
   task precheckin (dependsOn: [ build, integrationTest, distributedTest ]) {
     description 'Run this task before checking in code to validate changes. This task combines the following tasks: build, integrationTest, and distributedTest'

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6b61d492/gemfire-assembly/build.gradle
----------------------------------------------------------------------
diff --git a/gemfire-assembly/build.gradle b/gemfire-assembly/build.gradle
index a3f26a9..5930f13 100755
--- a/gemfire-assembly/build.gradle
+++ b/gemfire-assembly/build.gradle
@@ -16,27 +16,27 @@
  */
 import org.gradle.api.internal.artifacts.publish.ArchivePublishArtifact;
 
-buildscript {
-    repositories {
-        mavenCentral()
-    }
-    dependencies {
-        classpath group: 'org.hibernate.build.gradle', name: 'gradle-maven-publish-auth', version: project.'gradle-maven-publish-auth.version'
-    }
-}
 
 apply plugin: 'distribution'
-apply plugin: 'maven-publish'
-apply plugin: 'maven-publish-auth'
 
 jar.enabled = false
+extraArchive {
+  sources = false
+  javadoc = false
+  tests = false
+}
 
-configurations {
-  archives
+// We are not publishing anything from this project into maven and using two distributions seems
+// to break the nexus plugin.  So we delete the nexus tasks but we have to replace the upload task
+// with an empty task of the same name...argh.
+afterEvaluate {
+  tasks.remove(install)
+  tasks.remove(uploadArchives)
+  task uploadArchives << { }
 }
 
-// gradle doesn't automatically remove the jar artifact even though we disabled it
-// this causes the signing plugin to fail
+// Gradle doesn't automatically remove the jar artifact even though we disabled it
+// this causes publishing to fail.  So we nuke all the disabled artifacts from all configurations.
 configurations.all {
   artifacts.removeAll artifacts.findAll { it instanceof ArchivePublishArtifact && !it.archiveTask.enabled }
 }
@@ -191,13 +191,6 @@ gradle.taskGraph.whenReady( { graph ->
     archive.doLast {
       ant.checksum file:"${archive.archivePath}", algorithm:"md5"
       ant.checksum file:"${archive.archivePath}", algorithm:"sha-256"
-
-      if (isReleaseVersion) {      
-        signing {
-          required { isReleaseVersion }
-          sign archive.archivePath
-        }
-      }
     }
   }
 })
@@ -263,12 +256,15 @@ distributions {
           include 'spring-data-gemfire-*'
         }
         from project(":gemfire-core").configurations.archives.allArtifacts.files
-
+        from project(":gemfire-core").webJar
+        from project(":gemfire-core").raJar
+        from project(":gemfire-core").jcaJar
+        
         from project(":gemfire-lucene").configurations.runtime
         from project(":gemfire-lucene").configurations.archives.allArtifacts.files
 
         // include this jar        
-        from project(":gemfire-web-api").jar.outputs.files.getFiles()
+        from project(":gemfire-web-api").jar
         
         // dependency jars
         from depsJar
@@ -287,79 +283,6 @@ distributions {
   }
 }
 
-
-// Repos to be added to POMs
-def springReleaseRepo = [ id:'spring-release', name:'Spring Maven RELEASE Repository', url:'https://repo.spring.io/release' ]
-def springMilestoneRepo = [ id:'spring-milestone', name:'Spring Maven MILESTONE Repository', url:'https://repo.spring.io/milestone' ]
-def springSnapshotRepo = [ id:'spring-snapshot', name:'Spring Maven SNAPSHOT Repository', url:'https://repo.spring.io/snapshot' ]
-def springLibsReleaseRepo = [ id:'libs-release', name:'Spring Maven libs-release Repository', url:'http://repo.spring.io/libs-release' ]
-def springExtReleaseLocalRepo = [ id:'ext-release-local', name:'Spring Maven ext-release-local Repository', url:'http://repo.spring.io/ext-release-local' ]
-
-def MavenRepos = [ springReleaseRepo, springSnapshotRepo, springLibsReleaseRepo, springExtReleaseLocalRepo ]
-
-// Jars to be published via Maven
-def commonJar = [publicationName:'commonJar', project:project(":gemfire-common").name]
-def coreJar = [publicationName:'coreJar', project:project(":gemfire-core").name]
-def jsonJar = [publicationName:'jsonJar', project:project(":gemfire-json").name]
-def joptsimpleJar = [publicationName:'joptsimpleJar', project:project(":gemfire-joptsimple").name]
-def luceneJar = [publicationName:'luceneJar', project:project(":gemfire-lucene").name]
-def MavenJars = [ coreJar, jsonJar, joptsimpleJar, commonJar, luceneJar ]
-
-afterEvaluate {
-  publishing {
-    publications {
-      MavenJars.each {
-        def publicationName = it.publicationName
-        def projectName = it.project
-        "$publicationName"(MavenPublication) {
-          artifactId projectName
-          artifact project(':' + projectName).jar
-          pom.withXml {
-            def repositoriesNode = asNode().appendNode('repositories')
-            MavenRepos.each {
-              def repositoryNode = repositoriesNode.appendNode('repository')
-              repositoryNode.appendNode('id', it.id)
-              repositoryNode.appendNode('name', it.name)
-              repositoryNode.appendNode('url', it.url)
-            }
-            def dependenciesNode = asNode().appendNode('dependencies')
-            //Iterate over the runtime dependencies
-            project(':' + projectName).configurations.runtime.allDependencies.each {
-              def dependencyNode = dependenciesNode.appendNode('dependency')
-              dependencyNode.appendNode('groupId', it.group)
-              dependencyNode.appendNode('artifactId', it.name)
-              dependencyNode.appendNode('version', it.version)
-            }
-          }
-        }
-      }
-    }
-  }
-
-  // The following is typically defined in a root ASF pom: org.apache:apache
-  // If anything breaks around publishing check that we're still synchronized
-  // with whatever Maven repo definitions are there. Pay special attention to
-  // the names of the repositories -- they need to be spelled exactly like
-  // the ones defined in root ASF pom
-  publishing {
-    repositories {
-      if (!isReleaseVersion) {
-        // Apache Development Snapshot Repository
-        maven {
-          name "apache.snapshots.https"
-          url "https://repository.apache.org/content/repositories/snapshots"
-        }
-      } else {
-        // Apache Release Distribution Repository
-        maven {
-          name "apache.releases.https"
-          url "https://repository.apache.org/service/local/staging/deploy/maven2"
-        }
-      }
-    }
-  } 
-}
-
 // Create a configuration closure to configure test targets with the install directory
 def dependOnInstalledProduct = {
   dependsOn installDist
@@ -371,9 +294,5 @@ def dependOnInstalledProduct = {
 test dependOnInstalledProduct
 distributedTest dependOnInstalledProduct
 
-artifacts {
-  archives depsJar, gfshDepsJar
-}
-
 // Make build final task to generate all test and product resources
 build.dependsOn installDist

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6b61d492/gemfire-core/build.gradle
----------------------------------------------------------------------
diff --git a/gemfire-core/build.gradle b/gemfire-core/build.gradle
index 3e3c19b..041dc07 100755
--- a/gemfire-core/build.gradle
+++ b/gemfire-core/build.gradle
@@ -196,10 +196,6 @@ task jcaJar (type: Jar, dependsOn: raJar) {
   from raJar.archivePath
 }
 
-artifacts {
-  archives webJar, raJar, jcaJar
-}
-
 configurations {
   classesOutput {
     extendsFrom compile

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6b61d492/gemfire-web-api/build.gradle
----------------------------------------------------------------------
diff --git a/gemfire-web-api/build.gradle b/gemfire-web-api/build.gradle
index 7c35ecd..940fddd 100755
--- a/gemfire-web-api/build.gradle
+++ b/gemfire-web-api/build.gradle
@@ -49,10 +49,6 @@ jar {
   from sourceSets.main.output
 }
 
-artifacts {
-  archives jar
-}
-
 war {
   classpath configurations.runtime
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6b61d492/gemfire-web/build.gradle
----------------------------------------------------------------------
diff --git a/gemfire-web/build.gradle b/gemfire-web/build.gradle
index 1c926c0..596590b 100755
--- a/gemfire-web/build.gradle
+++ b/gemfire-web/build.gradle
@@ -50,10 +50,6 @@ idea.module.iml {
   }
 }
 
-artifacts {
-  archives jar
-}
-
 war {
   classpath configurations.runtime 
   classpath project(':gemfire-core').webJar.archivePath

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6b61d492/gradle/dependency-versions.properties
----------------------------------------------------------------------
diff --git a/gradle/dependency-versions.properties b/gradle/dependency-versions.properties
index 0bbbccd..901bdd5 100644
--- a/gradle/dependency-versions.properties
+++ b/gradle/dependency-versions.properties
@@ -13,9 +13,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Buildscript Dependencies
-gradle-maven-publish-auth.version = 2.0.1
-
 # Dependency versions
 activation.version = 1.1.1
 annotations.version = 3.0.0