Skip to content

build: publish to Maven Central via the Central Portal#3

Merged
onamfc merged 1 commit into
mainfrom
brandon/maven-central-publishing
Jun 11, 2026
Merged

build: publish to Maven Central via the Central Portal#3
onamfc merged 1 commit into
mainfrom
brandon/maven-central-publishing

Conversation

@onamfc

@onamfc onamfc commented Jun 11, 2026

Copy link
Copy Markdown
Member

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 + signing config with the com.vanniktech.maven.publish plugin pointed at SonatypeHost.CENTRAL_PORTAL:

  • Coordinates (GROUP / POM_ARTIFACT_ID / VERSION_NAME) and POM metadata (POM_*) are still read from gradle.properties — those properties already use this plugin's naming conventions, so no pom {} block is needed.
  • Automatically builds the sources + javadoc (Dokka) jars that Maven Central requires (the old config produced neither).
  • Credentials and the signing key are read from the developer's ~/.gradle/gradle.properties (mavenCentralUsername / mavenCentralPassword / signingInMemoryKey / signingInMemoryKeyPassword) — never committed.

Verified locally

  • ./gradlew :sdk:tasks resolves the plugin (no version incompatibility on Gradle 8.5 / AGP 8.2.2); publishAndReleaseToMavenCentral + publishToMavenCentral tasks present.
  • ./gradlew :sdk:signMavenPublication builds + signs all artifacts successfully.
  • ./gradlew :sdk:testDebugUnitTest — BUILD SUCCESSFUL.

After merge

Publish with ./gradlew publishAndReleaseToMavenCentral once the com.linkforty namespace is verified on the Central Portal.

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.
@onamfc onamfc merged commit 5804d25 into main Jun 11, 2026
3 checks passed
@onamfc onamfc deleted the brandon/maven-central-publishing branch June 11, 2026 17:54
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