Skip to content

Publish by Using the Portal OSSRH Staging API #191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 21, 2025

Conversation

AdamVe
Copy link
Member

@AdamVe AdamVe commented Jul 18, 2025

See https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/ for details.

To publish with the new service one needs:

  1. obtain a new token from central.sonatype.com and update local sonatype.username
  2. run ./gradlew publish finalizeCentralPublication
  3. Publish the publication from https://central.sonatype.com/publishing

@AdamVe AdamVe requested a review from Copilot July 18, 2025 18:34
Copilot

This comment was marked as outdated.

@AdamVe AdamVe requested a review from Copilot July 18, 2025 18:41
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the project to use Sonatype's new OSSRH Staging API for publishing artifacts to Maven Central, replacing the legacy staging repository URL. The changes include updating repository URLs, adding a new Gradle task for finalizing publications, and updating documentation to reflect the new workflow.

Key changes:

  • Updated repository URLs from the legacy oss.sonatype.org to the new ossrh-staging-api.central.sonatype.com
  • Added a new finalizeCentralPublication Gradle task to notify Sonatype Central when manual uploads are complete
  • Updated publishing documentation with new workflow instructions and credential requirements

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

File Description
publish.gradle Updated Sonatype repository URL to use the new OSSRH Staging API endpoint
doc/publish.adoc Updated publishing instructions with new workflow steps and credential generation
buildSrc/src/main/groovy/project-convention-publishing.gradle Added new Gradle task for finalizing publications via API call
android/publish.gradle Updated Android-specific Sonatype repository URL to use the new endpoint
Comments suppressed due to low confidence (1)

buildSrc/src/main/groovy/project-convention-publishing.gradle:28

  • The variable name 'sonatypeBearerToken' is misleading. This is creating Basic authentication credentials, not a Bearer token. Consider renaming to 'basicAuthToken' or 'authCredentials'.
        def sonatypeBearerToken = "${sonatypeUserName}:${sonatypePassword}".bytes.encodeBase64().toString()

@AdamVe AdamVe merged commit ac55998 into release/2.8.2 Jul 21, 2025
1 check passed
@AdamVe AdamVe deleted the adamve/publish-through-ossrh-staging-api branch July 21, 2025 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants