Skip to content

Commit

Permalink
Fixed pom signing
Browse files Browse the repository at this point in the history
  • Loading branch information
evant committed Jul 8, 2017
1 parent 12897c7 commit 1838b55
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,6 @@ publishing {
artifact javadocsJar

if (signing.required) {
// Sign the pom.xml.
pom.withXml {
writeTo(project.ext.pomFile)
def pomAscFile = signing.sign(project.ext.pomFile).signatureFiles[0]
artifact(pomAscFile) {
classifier = null
extension = 'pom.asc'
}
project.ext.pomFile.delete()
}

// Sign the artifacts.
project.tasks.signArchives.signatureFiles.each {
artifact(it) {
Expand All @@ -125,6 +114,23 @@ publishing {
}
}

if (signing.required) {
project.afterEvaluate {
// Sign the pom.xml.
publishing.publications.lib(MavenPublication) {
pom.withXml {
writeTo(project.ext.pomFile)
def pomAscFile = signing.sign(project.ext.pomFile).signatureFiles[0]
artifact(pomAscFile) {
classifier = null
extension = 'pom.asc'
}
project.ext.pomFile.delete()
}
}
}
}

model {
tasks.publishLibPublicationToMavenLocal {
dependsOn(project.tasks.signArchives)
Expand Down

0 comments on commit 1838b55

Please sign in to comment.