From c609fb76b2958bf7109feaf1bb3675ed7be86af8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 14 Oct 2025 14:13:17 +0000 Subject: [PATCH] chore(deps): update plugin maven-central-publish to v0.9.0 Also update (clean up) the previous custom logic to publish to Maven Central as a single bundle zip, as the functionality is now included in the new plugin version. --- .github/workflows/release.yml | 2 +- build.gradle.kts | 114 +--------------------------------- gradle/libs.versions.toml | 2 +- 3 files changed, 4 insertions(+), 114 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 93ab0452..9129501f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -101,7 +101,7 @@ jobs: ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.MAVEN_GPG_PASSPHRASE }} ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSSRH_ACCESS_ID }} ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRH_TOKEN }} - run: ./gradlew publishAggregateMavenCentralDeployment -Prelease --no-scan --stacktrace + run: ./gradlew publishAllModulesToMavenCentralPortalRepository -Prelease --no-scan --stacktrace - name: Bump to next development version run: echo "${NEXT_VERSION}-SNAPSHOT" > version.txt diff --git a/build.gradle.kts b/build.gradle.kts index cf5eebb7..1f3f4516 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,13 +14,8 @@ * limitations under the License. */ -import io.github.zenhelix.gradle.plugin.MavenCentralUploaderPlugin.Companion.MAVEN_CENTRAL_PORTAL_NAME -import io.github.zenhelix.gradle.plugin.extension.MavenCentralUploaderExtension import io.github.zenhelix.gradle.plugin.extension.PublishingType -import io.github.zenhelix.gradle.plugin.task.PublishBundleMavenCentralTask -import io.github.zenhelix.gradle.plugin.task.ZipDeploymentTask import java.time.Duration -import org.gradle.api.publish.plugins.PublishingPlugin.PUBLISH_TASK_GROUP import org.jetbrains.gradle.ext.settings import org.jetbrains.gradle.ext.taskTriggers @@ -61,120 +56,15 @@ mavenCentralPortal { // baseUrl = "https://central.sonatype.com" uploader { // 2 seconds * 3600 = 7200 seconds = 2hrs - delayRetriesStatusCheck = Duration.ofSeconds(2) - maxRetriesStatusCheck = 3600 - - aggregate { - // Aggregate submodules into a single archive - modules = true - // Aggregate publications into a single archive for each module - modulePublications = true - } + statusCheckDelay = Duration.ofSeconds(2) + maxStatusChecks = 3600 } } -val mavenCentralDeploymentZipAggregation by configurations.creating - -mavenCentralDeploymentZipAggregation.isTransitive = true - -val zipAggregateMavenCentralDeployment by - tasks.registering(Zip::class) { - group = PUBLISH_TASK_GROUP - description = "Generates the aggregated Maven publication zip file." - - inputs.files(mavenCentralDeploymentZipAggregation) - from(mavenCentralDeploymentZipAggregation.map { zipTree(it) }) - // archiveFileName = mavenCentralPortal.deploymentName.orElse(project.name) - destinationDirectory.set(layout.buildDirectory.dir("aggregatedDistribution")) - doLast { logger.lifecycle("Built aggregated distribution ${archiveFile.get()}") } - } - -val publishAggregateMavenCentralDeployment by - tasks.registering(PublishBundleMavenCentralTask::class) { - group = PUBLISH_TASK_GROUP - description = - "Publishes the aggregated Maven publications $MAVEN_CENTRAL_PORTAL_NAME repository." - - dependsOn(zipAggregateMavenCentralDeployment) - inputs.file(zipAggregateMavenCentralDeployment.flatMap { it.archiveFile }) - - val task = this - - project.extensions.configure { - val ext = this - task.baseUrl.set(ext.baseUrl) - task.credentials.set( - ext.credentials.username.flatMap { username -> - ext.credentials.password.map { password -> - io.github.zenhelix.gradle.plugin.client.model.Credentials.UsernamePasswordCredentials( - username, - password, - ) - } - } - ) - - task.publishingType.set( - ext.publishingType.map { - when (it) { - PublishingType.AUTOMATIC -> - io.github.zenhelix.gradle.plugin.client.model.PublishingType.AUTOMATIC - PublishingType.USER_MANAGED -> - io.github.zenhelix.gradle.plugin.client.model.PublishingType.USER_MANAGED - } - } - ) - task.deploymentName.set(ext.deploymentName) - - task.maxRetriesStatusCheck.set(ext.uploader.maxRetriesStatusCheck) - task.delayRetriesStatusCheck.set(ext.uploader.delayRetriesStatusCheck) - - task.zipFile.set(zipAggregateMavenCentralDeployment.flatMap { it.archiveFile }) - } - } - // Configure the 'io.github.zenhelix.maven-central-publish' plugin to all projects allprojects.forEach { p -> p.pluginManager.withPlugin("maven-publish") { p.pluginManager.apply("io.github.zenhelix.maven-central-publish") - p.extensions.configure { - val aggregatedMavenCentralDeploymentZipPart by p.configurations.creating - aggregatedMavenCentralDeploymentZipPart.description = "Maven central publication zip" - val aggregatedMavenCentralDeploymentZipPartElements by p.configurations.creating - aggregatedMavenCentralDeploymentZipPartElements.description = - "Elements for the Maven central publication zip" - aggregatedMavenCentralDeploymentZipPartElements.isCanBeResolved = false - aggregatedMavenCentralDeploymentZipPartElements.extendsFrom( - aggregatedMavenCentralDeploymentZipPart - ) - aggregatedMavenCentralDeploymentZipPartElements.attributes { - attribute( - Usage.USAGE_ATTRIBUTE, - project.getObjects().named(Usage::class.java, "publication"), - ) - } - - val aggregatemavenCentralDeployment by - p.tasks.registering { - val zip = p.tasks.findByName("zipDeploymentMavenPublication") as ZipDeploymentTask - dependsOn(zip) - outputs.file(zip.archiveFile.get().asFile) - } - - val artifact = - p.artifacts.add( - aggregatedMavenCentralDeploymentZipPart.name, - aggregatemavenCentralDeployment, - ) { - builtBy(aggregatemavenCentralDeployment) - } - aggregatedMavenCentralDeploymentZipPart.outgoing.artifact(artifact) - - rootProject.dependencies.add( - mavenCentralDeploymentZipAggregation.name, - rootProject.dependencies.project(p.path, aggregatedMavenCentralDeploymentZipPart.name), - ) - } } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 4dd4b4bd..3c3d3118 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -67,7 +67,7 @@ tomcat-annotations-api = { module = "org.apache.tomcat:annotations-api", version idea-ext = { id = "org.jetbrains.gradle.plugin.idea-ext", version = "1.3" } jandex = { id = "com.github.vlsi.jandex", version.ref = "jandexPlugin" } jmh = { id = "me.champeau.jmh", version = "0.7.3" } -maven-central-publish = { id = "io.github.zenhelix.maven-central-publish", version = "0.8.0" } +maven-central-publish = { id = "io.github.zenhelix.maven-central-publish", version = "0.9.0" } protobuf = { id = "com.google.protobuf", version.ref = "protobufPlugin" } shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadowPlugin" } spotless = { id = "com.diffplug.spotless", version.ref = "spotlessPlugin" }