kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkr...@apache.org
Subject kafka git commit: KAFKA-2199 Make signing artifacts optional and disabled by default for SNAPSHOTs and allow remote Maven repository configuration from the command line.
Date Fri, 29 May 2015 21:52:53 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 3836c5786 -> 3d8494bca


KAFKA-2199 Make signing artifacts optional and disabled by
 default for SNAPSHOTs and allow remote Maven repository configuration from
 the command line.


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/3d8494bc
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/3d8494bc
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/3d8494bc

Branch: refs/heads/trunk
Commit: 3d8494bca3074f49567f352f6eedd1ed008eeabd
Parents: 3836c57
Author: Ewen Cheslack-Postava <me@ewencp.org>
Authored: Fri May 29 14:50:45 2015 -0700
Committer: Jay Kreps <jay.kreps@gmail.com>
Committed: Fri May 29 14:50:45 2015 -0700

----------------------------------------------------------------------
 README.md         |  3 +++
 build.gradle      | 50 ++++++++++++++++++++++++++------------------------
 gradle.properties |  4 ----
 3 files changed, 29 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/3d8494bc/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 946ec62..a9a5d1e 100644
--- a/README.md
+++ b/README.md
@@ -93,6 +93,9 @@ Please note for this to work you should create/update `~/.gradle/gradle.properti
     signing.password=
     signing.secretKeyRingFile=
 
+### Publishing the jars without signing to a local repository ###
+    ./gradlew -Dorg.gradle.project.skipSigning=true -Dorg.gradle.project.mavenUrl=file://path/to/repo
uploadArchivesAll
+
 ### Building the test jar ###
     ./gradlew testJar
 

http://git-wip-us.apache.org/repos/asf/kafka/blob/3d8494bc/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 3dca28e..30d1cf2 100644
--- a/build.gradle
+++ b/build.gradle
@@ -31,10 +31,13 @@ allprojects {
 
 ext {
     gradleVersion = "2.4"
-}
 
-def isVerificationRequired(project) {
-    project.gradle.startParameter.taskNames.any { it.contains("upload") }
+    skipSigning = project.hasProperty('skipSigning') && skipSigning.toBoolean()
+    shouldSign = !skipSigning && !version.endsWith("SNAPSHOT")
+
+    mavenUrl = project.hasProperty('mavenUrl') ? project.mavenUrl : ''
+    mavenUsername = project.hasProperty('mavenUsername') ? project.mavenUsername : ''
+    mavenPassword = project.hasProperty('mavenPassword') ? project.mavenPassword : ''
 }
 
 apply from: file('wrapper.gradle')
@@ -54,27 +57,26 @@ subprojects {
   uploadArchives {
     repositories {
       signing {
-          if (isVerificationRequired(project)) {
-              sign configurations.archives
-
-              // To test locally, replace mavenUrl in ~/.gradle/gradle.properties to file://localhost/tmp/myRepo/
-              mavenDeployer {
-                  beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment)
}
-                  repository(url: "${mavenUrl}") {
-                      authentication(userName: "${mavenUsername}", password: "${mavenPassword}")
-                  }
-                  afterEvaluate {
-                      pom.artifactId = "${archivesBaseName}"
-                      pom.project {
-                          name 'Apache Kafka'
-                          packaging 'jar'
-                          url 'http://kafka.apache.org'
-                          licenses {
-                              license {
-                                  name 'The Apache Software License, Version 2.0'
-                                  url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
-                                  distribution 'repo'
-                              }
+          required { shouldSign }
+          sign configurations.archives
+
+          // To test locally, replace mavenUrl in ~/.gradle/gradle.properties to file://localhost/tmp/myRepo/
+          mavenDeployer {
+              beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment)
}
+              repository(url: "${mavenUrl}") {
+                  authentication(userName: "${mavenUsername}", password: "${mavenPassword}")
+              }
+              afterEvaluate {
+                  pom.artifactId = "${archivesBaseName}"
+                  pom.project {
+                      name 'Apache Kafka'
+                      packaging 'jar'
+                      url 'http://kafka.apache.org'
+                      licenses {
+                          license {
+                              name 'The Apache Software License, Version 2.0'
+                              url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+                              distribution 'repo'
                           }
                       }
                   }

http://git-wip-us.apache.org/repos/asf/kafka/blob/3d8494bc/gradle.properties
----------------------------------------------------------------------
diff --git a/gradle.properties b/gradle.properties
index 90b1945..cd4050b 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -18,7 +18,3 @@ version=0.8.3-SNAPSHOT
 scalaVersion=2.10.5
 task=build
 org.gradle.jvmargs=-XX:MaxPermSize=512m -Xmx1024m
-
-mavenUrl=
-mavenUsername=
-mavenPassword=


Mime
View raw message