chore: publish to Maven Central Portal instead of retired OSSRH - #3
Merged
Conversation
OSSRH (oss.sonatype.org) was shut down on 2025-06-30, so the previous `./gradlew publish` to the staging deploy endpoint no longer works. Migrates publishing to the Sonatype Central Portal via the com.vanniktech.maven.publish plugin (0.34.0), which handles the sources jar, the Dokka javadoc jar, signing and the upload + automatic release. - build.gradle.kts: replace the hand-rolled maven-publish/signing setup with a mavenPublishing block targeting Central Portal. - gradle-wrapper: bump 8.3 -> 8.5 (plugin 0.34.0 minimum). - release.yml: run publishToMavenCentral, add setup-java, and switch to the mavenCentral* / signingInMemory* credential env vars.
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
OSSRH (
oss.sonatype.org) was shut down on 2025-06-30. The release job published to its staging deploy endpoint via./gradlew publish, which no longer works. Publishing must move to the Sonatype Central Portal.What
Migrates publishing to the Central Portal using the
com.vanniktech.maven.publishplugin (0.34.0), which handles the sources jar, the Dokka javadoc jar, signing, and the upload + automatic release.build.gradle.kts— replaces the hand-rolledmaven-publish/signingblocks and manualsourcesJar/javadocJartasks with amavenPublishing { publishToMavenCentral(automaticRelease = true) }block. POM unchanged.gradle-wrapper.properties— Gradle8.3→8.5(minimum for plugin0.34.0; last line that still supports Kotlin 1.9.20 / JDK 8 target)..github/workflows/release.yml— runspublishToMavenCentral, addssetup-java(JDK 17, plugin needs ≥11 to run), bumpscheckoutv2 → v4, and switches to the new credential env vars.Required secrets (Central Portal user token)
MAVEN_CENTRAL_USERNAMEMAVEN_CENTRAL_PASSWORDSIGNING_KEY/SIGNING_PASSWORDOSSRH_USERNAME/OSSRH_PASSWORDare no longer used.Validation
Build script compiles under Gradle 8.5 and the plugin applies cleanly;
publishToMavenCentral --dry-runresolves the full Central Portal task graph (prepareMavenCentralPublishing,signMavenPublication,publishMavenPublicationToMavenCentralRepository,enableAutomaticMavenCentralPublishing).