Skip to content

Commit e88f179

Browse files
chore: switch to Sonatype Central Portal for publishing
- Replace nexus-staging-maven-plugin with central-publishing-maven-plugin - Update distributionManagement URLs to central.sonatype.com - Update release.yml to use CENTRAL_USERNAME/CENTRAL_TOKEN secrets
1 parent 7201a06 commit e88f179

2 files changed

Lines changed: 12 additions & 13 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
java-version: '17'
2020
distribution: 'temurin'
2121
cache: maven
22-
server-id: ossrh
22+
server-id: central
2323
server-username: MAVEN_USERNAME
2424
server-password: MAVEN_PASSWORD
2525
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
@@ -37,8 +37,8 @@ jobs:
3737

3838
- name: Build and deploy to Maven Central
3939
env:
40-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
41-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
40+
MAVEN_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
41+
MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN }}
4242
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
4343
run: mvn clean deploy -Prelease -DskipTests -B
4444

pom.xml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -313,14 +313,13 @@
313313
</executions>
314314
</plugin>
315315
<plugin>
316-
<groupId>org.sonatype.plugins</groupId>
317-
<artifactId>nexus-staging-maven-plugin</artifactId>
318-
<version>${nexus-staging-plugin.version}</version>
316+
<groupId>org.sonatype.central</groupId>
317+
<artifactId>central-publishing-maven-plugin</artifactId>
318+
<version>0.6.0</version>
319319
<extensions>true</extensions>
320320
<configuration>
321-
<serverId>ossrh</serverId>
322-
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
323-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
321+
<publishingServerId>central</publishingServerId>
322+
<autoPublish>true</autoPublish>
324323
</configuration>
325324
</plugin>
326325
</plugins>
@@ -330,12 +329,12 @@
330329

331330
<distributionManagement>
332331
<snapshotRepository>
333-
<id>ossrh</id>
334-
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
332+
<id>central</id>
333+
<url>https://central.sonatype.com/api/v1/publisher/deployments</url>
335334
</snapshotRepository>
336335
<repository>
337-
<id>ossrh</id>
338-
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
336+
<id>central</id>
337+
<url>https://central.sonatype.com/api/v1/publisher/deployments</url>
339338
</repository>
340339
</distributionManagement>
341340
</project>

0 commit comments

Comments
 (0)