KAFKA-2199 Make signing artifacts optional and disabled by

default for SNAPSHOTs and allow remote Maven repository configuration from
 the command line.
This commit is contained in:
Ewen Cheslack-Postava 2015-05-29 14:50:45 -07:00 committed by Jay Kreps
parent 3836c57865
commit 3d8494bca3
3 changed files with 28 additions and 27 deletions

View File

@ -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

View File

@ -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
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'
}
// 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'
}
}
}

View File

@ -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=