mirror of https://github.com/apache/kafka.git
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:
parent
3836c57865
commit
3d8494bca3
|
@ -93,6 +93,9 @@ Please note for this to work you should create/update `~/.gradle/gradle.properti
|
||||||
signing.password=
|
signing.password=
|
||||||
signing.secretKeyRingFile=
|
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 ###
|
### Building the test jar ###
|
||||||
./gradlew testJar
|
./gradlew testJar
|
||||||
|
|
||||||
|
|
48
build.gradle
48
build.gradle
|
@ -31,10 +31,13 @@ allprojects {
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
gradleVersion = "2.4"
|
gradleVersion = "2.4"
|
||||||
}
|
|
||||||
|
|
||||||
def isVerificationRequired(project) {
|
skipSigning = project.hasProperty('skipSigning') && skipSigning.toBoolean()
|
||||||
project.gradle.startParameter.taskNames.any { it.contains("upload") }
|
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')
|
apply from: file('wrapper.gradle')
|
||||||
|
@ -54,27 +57,26 @@ subprojects {
|
||||||
uploadArchives {
|
uploadArchives {
|
||||||
repositories {
|
repositories {
|
||||||
signing {
|
signing {
|
||||||
if (isVerificationRequired(project)) {
|
required { shouldSign }
|
||||||
sign configurations.archives
|
sign configurations.archives
|
||||||
|
|
||||||
// To test locally, replace mavenUrl in ~/.gradle/gradle.properties to file://localhost/tmp/myRepo/
|
// To test locally, replace mavenUrl in ~/.gradle/gradle.properties to file://localhost/tmp/myRepo/
|
||||||
mavenDeployer {
|
mavenDeployer {
|
||||||
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
|
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
|
||||||
repository(url: "${mavenUrl}") {
|
repository(url: "${mavenUrl}") {
|
||||||
authentication(userName: "${mavenUsername}", password: "${mavenPassword}")
|
authentication(userName: "${mavenUsername}", password: "${mavenPassword}")
|
||||||
}
|
}
|
||||||
afterEvaluate {
|
afterEvaluate {
|
||||||
pom.artifactId = "${archivesBaseName}"
|
pom.artifactId = "${archivesBaseName}"
|
||||||
pom.project {
|
pom.project {
|
||||||
name 'Apache Kafka'
|
name 'Apache Kafka'
|
||||||
packaging 'jar'
|
packaging 'jar'
|
||||||
url 'http://kafka.apache.org'
|
url 'http://kafka.apache.org'
|
||||||
licenses {
|
licenses {
|
||||||
license {
|
license {
|
||||||
name 'The Apache Software License, Version 2.0'
|
name 'The Apache Software License, Version 2.0'
|
||||||
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
|
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
|
||||||
distribution 'repo'
|
distribution 'repo'
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,3 @@ version=0.8.3-SNAPSHOT
|
||||||
scalaVersion=2.10.5
|
scalaVersion=2.10.5
|
||||||
task=build
|
task=build
|
||||||
org.gradle.jvmargs=-XX:MaxPermSize=512m -Xmx1024m
|
org.gradle.jvmargs=-XX:MaxPermSize=512m -Xmx1024m
|
||||||
|
|
||||||
mavenUrl=
|
|
||||||
mavenUsername=
|
|
||||||
mavenPassword=
|
|
||||||
|
|
Loading…
Reference in New Issue