Cleaned up build.gradle to allow local builds
@@ -54,10 +54,6 @@ if (!project.hasProperty('ossrhUsername')) {
}
tasks {
- signing {
- onlyIf {!version.endsWith("SNAPSHOT")}
- }
-
closeRepository {
onlyIf { nexusPublishing.useStaging.get() }
}
@@ -187,9 +183,10 @@ artifacts {
archives javadocJar, sourcesJar, examplesJar
}
+if (!version.endsWith("SNAPSHOT")) {
signing {
sign configurations.archives
- //sign publishing.publications.mavenJava
+ }
}
nexusStaging {
@@ -234,14 +231,18 @@ publishing {
pom.withXml {
def pomFile = file("${project.buildDir}/generated-pom.xml")
writeTo(pomFile)
+
+ if (!version.endsWith("SNAPSHOT")) {
def pomAscFile = signing.sign(pomFile).signatureFiles[0]
artifact(pomAscFile) {
classifier = null
extension = 'pom.asc'
}
}
+ }
// create the signed artifacts
+ if (!version.endsWith("SNAPSHOT")) {
project.tasks.signArchives.signatureFiles.each {
artifact(it) {
def matcher = it.file =~ /-(sources|javadoc|examples)\.jar\.asc$/
@@ -255,6 +256,7 @@ publishing {
}
}
}
+ }
nexusPublishing {
repositories {
@@ -269,9 +271,6 @@ publishing {
tasks.generatePomFileForMavenJavaPublication {
destination = file("$buildDir/generated-pom.xml")
}
- tasks.publishMavenJavaPublicationToMavenLocal {
- dependsOn project.tasks.signArchives
- }
tasks.publishMavenJavaPublicationToSonatypeRepository {
dependsOn project.tasks.signArchives
}
