Skip to content

Commit 8eb183e

Browse files
committed
Migrate from legacy OSSRH to Sonatype Central Portal
Replace nexus-staging-maven-plugin with central-publishing-maven-plugin (v0.10.0) as oss.sonatype.org has been sunset. The deploy was failing with 401 because OSSRH doesn't accept Central Portal tokens. Changes: - Replace nexus-staging-maven-plugin with central-publishing-maven-plugin - Update distributionManagement to use 'central' server ID - Update release.yml server-id to match - Enable autoPublish for CI deployments https://claude.ai/code/session_01ToqqHtNtg7kdm8TmAMZYe8
1 parent 29138da commit 8eb183e

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
with:
1616
java-version: '11'
1717
distribution: 'temurin'
18-
server-id: maven-central-staging
18+
server-id: central
1919
server-username: MAVEN_USERNAME
2020
server-password: MAVEN_PASSWORD
2121
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}

pom.xml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,10 @@
2727
</scm>
2828
<distributionManagement>
2929
<repository>
30-
<id>maven-central-staging</id>
31-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
30+
<id>central</id>
3231
</repository>
3332
<snapshotRepository>
34-
<id>maven-central-snapshots</id>
35-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
33+
<id>central</id>
3634
</snapshotRepository>
3735
</distributionManagement>
3836
<properties>
@@ -184,14 +182,13 @@
184182
</executions>
185183
</plugin>
186184
<plugin>
187-
<groupId>org.sonatype.plugins</groupId>
188-
<artifactId>nexus-staging-maven-plugin</artifactId>
189-
<version>1.7.0</version>
190-
<extensions>false</extensions>
185+
<groupId>org.sonatype.central</groupId>
186+
<artifactId>central-publishing-maven-plugin</artifactId>
187+
<version>0.10.0</version>
188+
<extensions>true</extensions>
191189
<configuration>
192-
<serverId>maven-central-staging</serverId>
193-
<nexusUrl>https://oss.sonatype.org</nexusUrl>
194-
<autoReleaseAfterClose />
190+
<publishingServerId>central</publishingServerId>
191+
<autoPublish>true</autoPublish>
195192
</configuration>
196193
</plugin>
197194
<plugin>

0 commit comments

Comments
 (0)