LUCENE-9975: don't require signing of 'unsignedJars' publication (maven artifacts published to the user's maven local repository, build folder and apache nexus). (#156)

This commit is contained in:
Dawid Weiss 2021-05-28 11:51:28 +02:00 committed by GitHub
parent 2160d7239d
commit 0a316b2495
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 10 deletions

View File

@ -179,7 +179,12 @@ configure(subprojects.findAll { it.path in rootProject.published }) { prj ->
} }
publications { publications {
jars(MavenPublication) { unsignedJars(MavenPublication)
jars(MavenPublication)
}
publications.each { publication ->
configure(publication) {
from components.java from components.java
groupId = project.group groupId = project.group
artifactId = project.archivesBaseName artifactId = project.archivesBaseName
@ -189,12 +194,12 @@ configure(subprojects.findAll { it.path in rootProject.published }) { prj ->
pom(configurePom) pom(configurePom)
// LUCENE-9561:
// Remove dependencyManagement section created by a combination of
// Palantir and the publishing plugin.
//
// https://github.com/palantir/gradle-consistent-versions/issues/550
pom({ pom({
// LUCENE-9561:
// Remove dependencyManagement section created by a combination of
// Palantir and the publishing plugin.
//
// https://github.com/palantir/gradle-consistent-versions/issues/550
withXml { withXml {
def dm = asNode().dependencyManagement def dm = asNode().dependencyManagement
if (dm) dm.replaceNode {} if (dm) dm.replaceNode {}
@ -209,11 +214,11 @@ configure(subprojects.findAll { it.path in rootProject.published }) { prj ->
group "Publishing" group "Publishing"
description "Publish Maven JARs and POMs to Apache Snapshots repository: ${apacheNexusSnapshots}" description "Publish Maven JARs and POMs to Apache Snapshots repository: ${apacheNexusSnapshots}"
dependsOn "publishJarsPublicationToApacheSnapshotsRepository" dependsOn "publishUnsignedJarsPublicationToApacheSnapshotsRepository"
} }
// 'jars' publication is always signed. We currently don't use it anywhere though.
signing { signing {
required { !version.endsWith("SNAPSHOT") }
sign publishing.publications.jars sign publishing.publications.jars
} }
} }

View File

@ -53,11 +53,11 @@ configure(rootProject) {
} }
} }
tasks.matching { it.name == "publishJarsPublicationToMavenLocal" }.all { task -> tasks.matching { it.name == "publishUnsignedJarsPublicationToMavenLocal" }.all { task ->
mavenToLocalRepo.dependsOn task mavenToLocalRepo.dependsOn task
} }
tasks.matching { it.name == "publishJarsPublicationToBuildRepository" }.all { task -> tasks.matching { it.name == "publishUnsignedJarsPublicationToBuildRepository" }.all { task ->
// Clean local repo prior to republishing artifacts. // Clean local repo prior to republishing artifacts.
task.dependsOn mavenLocalClean task.dependsOn mavenLocalClean
// Attach to root project's mavenLocal task. // Attach to root project's mavenLocal task.