# pkmerboot-central-publisher **Repository Path**: pkmer/pkmerboot-central-publisher ## Basic Information - **Project Name**: pkmerboot-central-publisher - **Description**: 😘The plugin is used for publishing through the Central Portal - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 0 - **Created**: 2024-08-23 - **Last Updated**: 2025-04-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Pkmerboot Central Publisher Gradle Plugin Welcome to the English version of the project! [Chinese Version](attachments/docs/README_zh.md) # What this `pkmerboot-central-publisher` plugin can do Currently, According to [Sonatype Maven Central Repository](https://central.sonatype.com/),the [publishing via the Central Portal](https://central.sonatype.org/publish-ea/publish-ea-guide/) will replace the legacy [Publishing via OSSRH](https://central.sonatype.org/publish/publish-gradle/). A statement from the [official website](https://central.sonatype.org/faq/what-happened-to-issues-sonatype-org/): `On Jan 9th, 2024, we announced that issues.sonatype.org will be decommissioned soon.` However, there is currently no official Gradle plugin to do this.**Therefore, this project aims to solve this problem.** ## The general idea This project is based on the [maven-publish](https://docs.gradle.org/current/userguide/publishing_maven.html#publishing_maven) and [signing](https://docs.gradle.org/current/userguide/signing_plugin.html#signing_plugin) plugins provided by Gradle. First, it publishes to a local repository using `maven-publish`, with [GPG](https://central.sonatype.org/publish/requirements/gpg/) signing handled by the `signing plugin`. Then, the project’s plugin packages everything into a ZIP file and uploads it to the [Central Repository](https://central.sonatype.com/) via the [Sonatype Publish API](https://central.sonatype.com/api-doc). # Usage > Download the plugin from maven central repository or gradle plugin portal. 1. [gradle plugin portal of the plugin](https://plugins.gradle.org/plugin/io.gitee.pkmer.pkmerboot-central-publisher) 2. [maven central repository of the plugin](https://central.sonatype.com/artifact/io.gitee.pkmer.sonatype-central-publisher/io.gitee.pkmer.sonatype-central-publisher.gradle.plugin) ## 1. Apply this plugin ```groovy plugins { // ... another plugins id "io.gitee.pkmer.pkmerboot-central-publisher" version "1.1.1" } ``` ## 2. Add configuration First, configure the `maven-publish` plugin. Refer to the [official maven-publish plugin documentation](https://docs.gradle.org/current/userguide/publishing_maven.html#publishing_maven) or [the usage examples](https://gitee.com/pkmer/sonatype-central-publisher/tree/master/examples/use-sonatype-central-publisher-plugin). ```groovy publishing { repositories { maven { name = "Local" url = layout.buildDirectory.dir('repos/bundles') // Specify the local staging repo path in the configuration. } } } ``` Second,configure this `sonatype-central-publisher` plugin ```groovy pkmerBoot { sonatypeMavenCentral{ // the same with publishing.repositories.maven.url in the configuration. stagingRepository = layout.buildDirectory.dir("repos/bundles") /** * get username and password from * central sonatype account */ username = "YOUR Central Maven Repository USERNAME" password = "YOUR Central Maven Repository PASSWORD" // Optional the publishingType default value is PublishingType.AUTOMATIC publishingType = PublishingType.AUTOMATIC } } ``` ## 3. publishing to the Central Portal You are now ready to start the task of publishing to the Central Portal. ```shell # windows .\gradlew.bat publishToMavenCentralPortal # linux ./gradlew publishToMavenCentralPortal # others install gradle on system gradle publishToMavenCentralPortal ``` > The result of `AUTOMATIC` publishingType The value `PUBLISHING` of deploymentState ![img.png](attachments/img.png) The value `PUBLISHED` of deploymentState ![img.png](attachments/img-1.png)