Skip to content

Commit 6e5cf7a

Browse files
veloclaude
andauthored
Migrate from OSSRH to Sonatype Central Portal (#1290)
* Migrate from OSSRH to Sonatype Central Portal Update Maven publishing configuration to use Central Portal APIs ahead of OSSRH sunset on June 30, 2025: - Replace nexus-staging-maven-plugin with central-publishing-maven-plugin - Update distribution management URLs to use Central Portal endpoints - Update CI settings.xml to use new Central Portal authentication This migration ensures continued publishing capability after OSSRH EOL. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Update CircleCI to use 'central' context for Central Portal credentials - Change context from 'Sonatype' to 'central' for both snapshot and release deployments - This matches the CircleCI context containing CENTRAL_TOKEN_USERNAME and CENTRAL_TOKEN_PASSWORD --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent a99d56a commit 6e5cf7a

File tree

3 files changed

+16
-17
lines changed

3 files changed

+16
-17
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,14 +516,14 @@ workflows:
516516
name: 'deploy snapshot'
517517
requires:
518518
- 'snapshot'
519-
context: Sonatype
519+
context: central
520520
filters:
521521
<<: *master-only
522522

523523
release:
524524
jobs:
525525
- deployRelease:
526526
name: 'release to maven central'
527-
context: Sonatype
527+
context: central
528528
filters:
529529
<<: *tags-only

.circleci/settings.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
http://maven.apache.org/xsd/settings-1.0.0.xsd">
2020
<servers>
2121
<server>
22-
<id>ossrh</id>
23-
<username>${env.SONATYPE_USER}</username>
24-
<password>${env.SONATYPE_PASSWORD}</password>
22+
<id>central</id>
23+
<username>${env.CENTRAL_TOKEN_USERNAME}</username>
24+
<password>${env.CENTRAL_TOKEN_PASSWORD}</password>
2525
</server>
2626
</servers>
2727
<profiles>
2828
<profile>
29-
<id>ossrh</id>
29+
<id>central</id>
3030
<activation>
3131
<activeByDefault>true</activeByDefault>
3232
</activation>

pom.xml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@
7777

7878
<distributionManagement>
7979
<repository>
80-
<id>ossrh</id>
81-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
80+
<id>central</id>
81+
<url>https://central.sonatype.com/api/v1/publisher/deployments/upload/</url>
8282
</repository>
8383
<snapshotRepository>
84-
<id>ossrh</id>
85-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
84+
<id>central</id>
85+
<url>https://central.sonatype.com/api/v1/publisher/deployments/upload/</url>
8686
</snapshotRepository>
8787
</distributionManagement>
8888

@@ -802,15 +802,14 @@
802802
<build>
803803
<plugins>
804804
<plugin>
805-
<groupId>org.sonatype.plugins</groupId>
806-
<artifactId>nexus-staging-maven-plugin</artifactId>
807-
<version>1.7.0</version>
805+
<groupId>org.sonatype.central</groupId>
806+
<artifactId>central-publishing-maven-plugin</artifactId>
807+
<version>0.8.0</version>
808808
<extensions>true</extensions>
809809
<configuration>
810-
<serverId>ossrh</serverId>
811-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
812-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
813-
<stagingProgressTimeoutMinutes>15</stagingProgressTimeoutMinutes>
810+
<publishingServerId>central</publishingServerId>
811+
<autoPublish>true</autoPublish>
812+
<waitUntil>published</waitUntil>
814813
</configuration>
815814
</plugin>
816815
</plugins>

0 commit comments

Comments
 (0)