Skip to content

Commit 817cb8b

Browse files
git-wrightclaude
andcommitted
Migrate Maven Central publishing to Sonatype Central Portal
Sonatype shut down OSSRH (oss.sonatype.org) on 2025-06-30. The release workflow still published through it, so v1.3.5's publish job failed silently after tag/release (issue #84) and the library has been stuck at 1.3.4 on Maven Central since Dec 2024. Replaces the manual OSSRH staging config, custom get_staging_repository_id.py script, and nexus-actions third-party action with the gradle-nexus/publish-plugin, which talks to the Central Portal's compatibility endpoint and does stage/close/release in one Gradle command. Bumps version to 1.3.6 so the fixed pipeline runs end-to-end on merge. Note: MAVEN_USERNAME/MAVEN_PASSWORD secrets must be rotated to a Sonatype Central Portal user token before this can publish successfully -- the old OSSRH credentials return 401 against the new endpoint regardless of this change. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 94f25a2 commit 817cb8b

4 files changed

Lines changed: 17 additions & 60 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -72,32 +72,13 @@ jobs:
7272
cat <<FILE > _gradle_user_home/gradle.properties
7373
github.username=${{ secrets.PUSHER_CI_GITHUB_PRIVATE_TOKEN }}
7474
github.password=""
75-
maven.username=${{ secrets.MAVEN_USERNAME }}
76-
maven.password=${{ secrets.MAVEN_PASSWORD }}
75+
sonatypeUsername=${{ secrets.MAVEN_USERNAME }}
76+
sonatypePassword=${{ secrets.MAVEN_PASSWORD }}
7777
signing.keyId=${{ secrets.SIGNING_KEY_ID }}
7878
signing.password=${{ secrets.SIGNING_PASSWORD }}
7979
signing.secretKeyRingFile=_gradle_user_home/pusher-maven-gpg-signing-key.gpg
8080
FILE
8181
echo "${{ secrets.PUSHER_MAVEN_GPG_SIGNING_KEY }}" | base64 --decode > _gradle_user_home/pusher-maven-gpg-signing-key.gpg
8282
- name: Publish
8383
run: |
84-
./gradlew publish
85-
86-
finish-release:
87-
runs-on: ubuntu-latest
88-
needs: publish
89-
env:
90-
NEXUS_USERNAME: ${{ secrets.MAVEN_USERNAME }}
91-
NEXUS_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
92-
steps:
93-
- uses: actions/checkout@v4
94-
- id: get_staging_repository_id
95-
name: Get staging repository id
96-
run: |
97-
echo "staging_repository_id=$(python3 scripts/get_staging_repository_id.py)" >> $GITHUB_OUTPUT
98-
- name: Release
99-
uses: nexus-actions/release-nexus-staging-repo@main
100-
with:
101-
username: ${{ secrets.MAVEN_USERNAME }}
102-
password: ${{ secrets.MAVEN_PASSWORD }}
103-
staging_repository_id: ${{ steps.get_staging_repository_id.outputs.staging_repository_id }}
84+
./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 1.3.6
4+
5+
- [CHANGED] Migrate Maven Central publishing from the retired Sonatype OSSRH service to the Sonatype Central Portal, via the gradle-nexus/publish-plugin. 1.3.5 was tagged and released on GitHub but never reached Maven Central because OSSRH had already shut down; this release re-publishes the same code through the working pipeline.
6+
37
## 1.3.5
48

59
- [CHANGED] Update async-http-client to 3.0.6.

build.gradle

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ plugins {
1010
id 'java-library'
1111
id 'maven-publish'
1212
id "signing"
13+
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
1314
}
1415

1516
def getProperty = { property ->
@@ -24,7 +25,7 @@ repositories {
2425
}
2526

2627
group = "com.pusher"
27-
version = "1.3.5"
28+
version = "1.3.6"
2829
description = "Pusher HTTP Client"
2930

3031
// Netty version override to address CVE-2025-24970, CVE-2025-25193, CVE-2025-55163,
@@ -129,15 +130,15 @@ publishing {
129130
}
130131
}
131132
}
133+
}
134+
135+
nexusPublishing {
132136
repositories {
133-
maven {
134-
def releaseRepositoryUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
135-
def snapshotRepositoryUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
136-
url = version.endsWith("SNAPSHOT") ? snapshotRepositoryUrl : releaseRepositoryUrl
137-
credentials {
138-
username = findProperty("maven.username") ?: ""
139-
password = findProperty("maven.password") ?: ""
140-
}
137+
sonatype {
138+
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
139+
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
140+
username = findProperty("sonatypeUsername") ?: ""
141+
password = findProperty("sonatypePassword") ?: ""
141142
}
142143
}
143144
}

scripts/get_staging_repository_id.py

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)