build: publish to Maven Central via the Central Portal#3
Merged
Conversation
Sonatype sunset the legacy OSSRH endpoint (s01.oss.sonatype.org) that the previous publishing config targeted. Replace the manual maven-publish + signing setup with the com.vanniktech.maven.publish plugin pointed at the Central Portal (SonatypeHost.CENTRAL_PORTAL). - Coordinates and POM metadata are still read from gradle.properties (GROUP / POM_ARTIFACT_ID / VERSION_NAME / POM_*), which already use the plugin's conventions — no pom block needed. - Adds the required sources + javadoc (Dokka) jars automatically. - Credentials and signing key come from ~/.gradle/gradle.properties (mavenCentralUsername/Password, signingInMemoryKey[/Password]); never committed. Verified locally: publish tasks resolve, signMavenPublication signs all artifacts, and the unit tests still pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Sonatype sunset the legacy OSSRH endpoint (
s01.oss.sonatype.org) that the previous publishing config targeted, so it can no longer be used to publish. New publishing goes through the Central Portal (central.sonatype.com).What
Replaces the hand-rolled
maven-publish+signingconfig with thecom.vanniktech.maven.publishplugin pointed atSonatypeHost.CENTRAL_PORTAL:GROUP/POM_ARTIFACT_ID/VERSION_NAME) and POM metadata (POM_*) are still read fromgradle.properties— those properties already use this plugin's naming conventions, so nopom {}block is needed.~/.gradle/gradle.properties(mavenCentralUsername/mavenCentralPassword/signingInMemoryKey/signingInMemoryKeyPassword) — never committed.Verified locally
./gradlew :sdk:tasksresolves the plugin (no version incompatibility on Gradle 8.5 / AGP 8.2.2);publishAndReleaseToMavenCentral+publishToMavenCentraltasks present../gradlew :sdk:signMavenPublicationbuilds + signs all artifacts successfully../gradlew :sdk:testDebugUnitTest— BUILD SUCCESSFUL.After merge
Publish with
./gradlew publishAndReleaseToMavenCentralonce thecom.linkfortynamespace is verified on the Central Portal.