Skip to content

Commit 9fa9ec0

Browse files
author
Justin Ryan
committed
Avoid signatures in archives unless doing mavenCentral build
1 parent b5b2f5e commit 9fa9ec0

2 files changed

Lines changed: 19 additions & 16 deletions

File tree

build.gradle

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ subprojects {
2020
// Closure to configure all the POM with extra info, common to all projects
2121
pom {
2222
project {
23-
url "https://github.com/Netflix/${rootProject.githubProjectName}"
24-
scm {
25-
connection "scm:git:[email protected]:Netflix/${rootProject.githubProjectName}.git"
26-
url "scm:git:[email protected]:Netflix/${rootProject.githubProjectName}.git"
27-
developerConnection "scm:git:[email protected]:Netflix/${rootProject.githubProjectName}.git"
28-
}
29-
issueManagement {
30-
system 'github'
31-
url 'https://github.com/Netflix/${rootProject.githubProjectName}/issues'
32-
}
23+
url "https://github.com/Netflix/${rootProject.githubProjectName}"
24+
scm {
25+
connection "scm:git:[email protected]:Netflix/${rootProject.githubProjectName}.git"
26+
url "scm:git:[email protected]:Netflix/${rootProject.githubProjectName}.git"
27+
developerConnection "scm:git:[email protected]:Netflix/${rootProject.githubProjectName}.git"
28+
}
29+
issueManagement {
30+
system 'github'
31+
url 'https://github.com/Netflix/${rootProject.githubProjectName}/issues'
32+
}
3333
}
3434
}
3535

@@ -57,7 +57,6 @@ project(':template-server') {
5757
compile 'com.sun.jersey:jersey-server:1.11'
5858
compile 'com.sun.jersey:jersey-servlet:1.11'
5959
compile project(':template-client')
60-
testCompile 'org.mockito:mockito-core:1.8.5'
6160
}
6261
}
6362

gradle/maven.gradle

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,21 @@ subprojects {
33
apply plugin: 'maven' // Java plugin has to have been already applied for the conf2scope mappings to work
44
apply plugin: 'signing'
55

6-
signing {
7-
required { performingRelease && gradle.taskGraph.hasTask("uploadArchives")}
8-
sign configurations.archives
6+
gradle.taskGraph.whenReady { taskGraph ->
7+
if (taskGraph.hasTask("uploadMavenCentral")) {
8+
signing {
9+
required true
10+
sign configurations.archives
11+
}
12+
}
913
}
1014

1115
/**
1216
* Publishing to Maven Central example provided from http://jedicoder.blogspot.com/2011/11/automated-gradle-project-deployment-to.html
1317
*/
14-
task uploadArchives(type:Upload) {
18+
task uploadMavenCentral(type:Upload) {
1519
configuration = configurations.archives
16-
dependsOn signArchives
20+
dependsOn 'signArchives'
1721
doFirst {
1822
repositories.mavenDeployer {
1923
beforeDeployment { org.gradle.api.artifacts.maven.MavenDeployment deployment -> signing.signPom(deployment) }

0 commit comments

Comments
 (0)