Skip to content

chore: publish to Maven Central Portal instead of retired OSSRH - #3

Merged
LeoColman merged 1 commit into
masterfrom
chore/maven-central-release
Jul 22, 2026
Merged

chore: publish to Maven Central Portal instead of retired OSSRH#3
LeoColman merged 1 commit into
masterfrom
chore/maven-central-release

Conversation

@LeoColman

Copy link
Copy Markdown
Owner

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.publish plugin (0.34.0), which handles the sources jar, the Dokka javadoc jar, signing, and the upload + automatic release.

  • build.gradle.kts — replaces the hand-rolled maven-publish / signing blocks and manual sourcesJar / javadocJar tasks with a mavenPublishing { publishToMavenCentral(automaticRelease = true) } block. POM unchanged.
  • gradle-wrapper.properties — Gradle 8.38.5 (minimum for plugin 0.34.0; last line that still supports Kotlin 1.9.20 / JDK 8 target).
  • .github/workflows/release.yml — runs publishToMavenCentral, adds setup-java (JDK 17, plugin needs ≥11 to run), bumps checkout v2 → v4, and switches to the new credential env vars.

Required secrets (Central Portal user token)

Secret Value
MAVEN_CENTRAL_USERNAME Central Portal user token username
MAVEN_CENTRAL_PASSWORD Central Portal user token password
SIGNING_KEY / SIGNING_PASSWORD unchanged (same GPG key)

OSSRH_USERNAME / OSSRH_PASSWORD are no longer used.

Validation

Build script compiles under Gradle 8.5 and the plugin applies cleanly; publishToMavenCentral --dry-run resolves the full Central Portal task graph (prepareMavenCentralPublishing, signMavenPublication, publishMavenPublicationToMavenCentralRepository, enableAutomaticMavenCentralPublishing).

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.
@LeoColman
LeoColman merged commit 9de40e2 into master Jul 22, 2026
2 checks passed
@LeoColman
LeoColman deleted the chore/maven-central-release branch July 22, 2026 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant