Skip to content

Commit 1838b55

Browse files
committed
Fixed pom signing
1 parent 12897c7 commit 1838b55

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

publish.gradle

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,6 @@ publishing {
9999
artifact javadocsJar
100100

101101
if (signing.required) {
102-
// Sign the pom.xml.
103-
pom.withXml {
104-
writeTo(project.ext.pomFile)
105-
def pomAscFile = signing.sign(project.ext.pomFile).signatureFiles[0]
106-
artifact(pomAscFile) {
107-
classifier = null
108-
extension = 'pom.asc'
109-
}
110-
project.ext.pomFile.delete()
111-
}
112-
113102
// Sign the artifacts.
114103
project.tasks.signArchives.signatureFiles.each {
115104
artifact(it) {
@@ -125,6 +114,23 @@ publishing {
125114
}
126115
}
127116

117+
if (signing.required) {
118+
project.afterEvaluate {
119+
// Sign the pom.xml.
120+
publishing.publications.lib(MavenPublication) {
121+
pom.withXml {
122+
writeTo(project.ext.pomFile)
123+
def pomAscFile = signing.sign(project.ext.pomFile).signatureFiles[0]
124+
artifact(pomAscFile) {
125+
classifier = null
126+
extension = 'pom.asc'
127+
}
128+
project.ext.pomFile.delete()
129+
}
130+
}
131+
}
132+
}
133+
128134
model {
129135
tasks.publishLibPublicationToMavenLocal {
130136
dependsOn(project.tasks.signArchives)

0 commit comments

Comments
 (0)