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:46 UTC
[1/4] incubator-geode git commit: GEODE-781: Update maven publishing
to include signatures
Repository: incubator-geode
Updated Branches:
refs/heads/release/1.0.0-incubating.M1 e2c35d7d4 -> e5a7b9aaa
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/e9bf2535
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/e9bf2535
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/e9bf2535
Branch: refs/heads/release/1.0.0-incubating.M1
Commit: e9bf2535fcd635bc183123138e1a8b28501f4374
Parents: e2c35d7
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:35:46 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/e9bf2535/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index f42f786..2322120 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 {
@@ -495,6 +473,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/e9bf2535/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/e9bf2535/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/e9bf2535/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/e9bf2535/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/e9bf2535/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
[3/4] incubator-geode git commit: GEODE-781: Another nexus / Jenkins
fix for uploading artifacts
Posted by ab...@apache.org.
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/f06a43fe
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/f06a43fe
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/f06a43fe
Branch: refs/heads/release/1.0.0-incubating.M1
Commit: f06a43fe8dbaee00b49d892d6b5207dd02c3fae6
Parents: fa60ac7
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:36:06 2016 -0800
----------------------------------------------------------------------
build.gradle | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f06a43fe/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 6004226..90d4a60 100755
--- a/build.gradle
+++ b/build.gradle
@@ -521,10 +521,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' }
}
}
[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/fa60ac7a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/fa60ac7a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/fa60ac7a
Branch: refs/heads/release/1.0.0-incubating.M1
Commit: fa60ac7acabd3deb6206002685810ce4a7897674
Parents: e9bf253
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:35:57 2016 -0800
----------------------------------------------------------------------
build.gradle | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/fa60ac7a/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 2322120..6004226 100755
--- a/build.gradle
+++ b/build.gradle
@@ -475,7 +475,6 @@ subprojects {
// publishing configuration
apply plugin: 'com.bmuschko.nexus'
- apply plugin: 'maven-publish-auth'
extraArchive {
sources = true
@@ -518,6 +517,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'
@@ -535,4 +545,3 @@ subprojects {
// Make sure clean task for rootProject runs last
clean.finalizedBy rootProject.clean
}
-
[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/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/release/1.0.0-incubating.M1
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()
+ }
+ }
+ }
}
}