diff --git a/gradle/publishing/defaults-maven.gradle b/gradle/publishing/defaults-maven.gradle index 2722c725b55..e5952b51c74 100644 --- a/gradle/publishing/defaults-maven.gradle +++ b/gradle/publishing/defaults-maven.gradle @@ -179,7 +179,12 @@ configure(subprojects.findAll { it.path in rootProject.published }) { prj -> } publications { - jars(MavenPublication) { + unsignedJars(MavenPublication) + jars(MavenPublication) + } + + publications.each { publication -> + configure(publication) { from components.java groupId = project.group artifactId = project.archivesBaseName @@ -189,12 +194,12 @@ configure(subprojects.findAll { it.path in rootProject.published }) { prj -> 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({ - // 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 { def dm = asNode().dependencyManagement if (dm) dm.replaceNode {} @@ -209,11 +214,11 @@ configure(subprojects.findAll { it.path in rootProject.published }) { prj -> group "Publishing" 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 { - required { !version.endsWith("SNAPSHOT") } sign publishing.publications.jars } } diff --git a/gradle/publishing/maven-local.gradle b/gradle/publishing/maven-local.gradle index 9d415b89463..e3d82680987 100644 --- a/gradle/publishing/maven-local.gradle +++ b/gradle/publishing/maven-local.gradle @@ -53,11 +53,11 @@ configure(rootProject) { } } - tasks.matching { it.name == "publishJarsPublicationToMavenLocal" }.all { task -> + tasks.matching { it.name == "publishUnsignedJarsPublicationToMavenLocal" }.all { 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. task.dependsOn mavenLocalClean // Attach to root project's mavenLocal task.