Browse Source

Avoid signatures in archives unless doing mavenCentral build

pull/1/head
Justin Ryan 13 years ago
parent
commit
9fa9ec0acc
  1. 21
      build.gradle
  2. 14
      gradle/maven.gradle

21
build.gradle

@ -20,16 +20,16 @@ subprojects { @@ -20,16 +20,16 @@ subprojects {
// Closure to configure all the POM with extra info, common to all projects
pom {
project {
url "https://github.com/Netflix/${rootProject.githubProjectName}"
scm {
connection "scm:git:git@github.com:Netflix/${rootProject.githubProjectName}.git"
url "scm:git:git@github.com:Netflix/${rootProject.githubProjectName}.git"
developerConnection "scm:git:git@github.com:Netflix/${rootProject.githubProjectName}.git"
}
issueManagement {
system 'github'
url 'https://github.com/Netflix/${rootProject.githubProjectName}/issues'
}
url "https://github.com/Netflix/${rootProject.githubProjectName}"
scm {
connection "scm:git:git@github.com:Netflix/${rootProject.githubProjectName}.git"
url "scm:git:git@github.com:Netflix/${rootProject.githubProjectName}.git"
developerConnection "scm:git:git@github.com:Netflix/${rootProject.githubProjectName}.git"
}
issueManagement {
system 'github'
url 'https://github.com/Netflix/${rootProject.githubProjectName}/issues'
}
}
}
@ -57,7 +57,6 @@ project(':template-server') { @@ -57,7 +57,6 @@ project(':template-server') {
compile 'com.sun.jersey:jersey-server:1.11'
compile 'com.sun.jersey:jersey-servlet:1.11'
compile project(':template-client')
testCompile 'org.mockito:mockito-core:1.8.5'
}
}

14
gradle/maven.gradle

@ -3,17 +3,21 @@ subprojects { @@ -3,17 +3,21 @@ subprojects {
apply plugin: 'maven' // Java plugin has to have been already applied for the conf2scope mappings to work
apply plugin: 'signing'
signing {
required { performingRelease && gradle.taskGraph.hasTask("uploadArchives")}
sign configurations.archives
gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.hasTask("uploadMavenCentral")) {
signing {
required true
sign configurations.archives
}
}
}
/**
* Publishing to Maven Central example provided from http://jedicoder.blogspot.com/2011/11/automated-gradle-project-deployment-to.html
*/
task uploadArchives(type:Upload) {
task uploadMavenCentral(type:Upload) {
configuration = configurations.archives
dependsOn signArchives
dependsOn 'signArchives'
doFirst {
repositories.mavenDeployer {
beforeDeployment { org.gradle.api.artifacts.maven.MavenDeployment deployment -> signing.signPom(deployment) }

Loading…
Cancel
Save