Skip to content

Commit 5f8f21e

Browse files
committed
feat: Migrate to Central Publisher Portal
Updates the release process to use the new Central Publisher Portal for deploying artifacts to Maven Central. - Replaces the nexus-staging-maven-plugin with the central-publishing-maven-plugin. - Updates the distributionManagement repository URL in pom.xml. - Modifies the publish script to use the central-publishing:publish goal. - Updates the release workflow to use token-based authentication secrets (CENTRAL_USERNAME, CENTRAL_TOKEN). - Adjusts settings.xml to use the new authentication tokens.
1 parent 1b5cf37 commit 5f8f21e

File tree

4 files changed

+17
-13
lines changed

4 files changed

+17
-13
lines changed

.github/resources/settings.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
<servers>
99
<server>
10-
<id>ossrh</id>
11-
<username>${env.NEXUS_OSSRH_USERNAME}</username>
12-
<password>${env.NEXUS_OSSRH_PASSWORD}</password>
10+
<id>central</id>
11+
<username>${env.CENTRAL_USERNAME}</username>
12+
<password>${env.CENTRAL_TOKEN}</password>
1313
</server>
1414
</servers>
1515

.github/scripts/publish_artifacts.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ gpg --import --no-tty --batch --yes firebase.asc
2626
# 1. Compiles the source (compile phase)
2727
# 2. Packages the artifacts - src, bin, javadocs (package phase)
2828
# 3. Signs the artifacts (verify phase)
29-
# 4. Publishes artifacts via Nexus (deploy phase)
29+
# 4. Publishes artifacts via Central Publisher Portal (deploy phase)
3030
mvn -B clean deploy \
3131
-Dcheckstyle.skip \
3232
-DskipTests \

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ jobs:
100100
env:
101101
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
102102
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
103-
NEXUS_OSSRH_USERNAME: ${{ secrets.NEXUS_OSSRH_USERNAME }}
104-
NEXUS_OSSRH_PASSWORD: ${{ secrets.NEXUS_OSSRH_PASSWORD }}
103+
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
104+
CENTRAL_TOKEN: ${{ secrets.CENTRAL_TOKEN }}
105105

106106
# See: https://cli.github.com/manual/gh_release_create
107107
- name: Create release tag

pom.xml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,13 @@
7171

7272
<distributionManagement>
7373
<snapshotRepository>
74-
<id>ossrh</id>
75-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
74+
<id>central</id>
75+
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
7676
</snapshotRepository>
77+
<repository>
78+
<id>central</id>
79+
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
80+
</repository>
7781
</distributionManagement>
7882

7983
<profiles>
@@ -351,13 +355,13 @@
351355
<!-- Deploy Phase -->
352356
<plugin>
353357
<groupId>org.sonatype.plugins</groupId>
354-
<artifactId>nexus-staging-maven-plugin</artifactId>
355-
<version>1.7.0</version>
358+
<artifactId>central-publishing-maven-plugin</artifactId>
359+
<version>0.8.0</version>
356360
<extensions>true</extensions>
357361
<configuration>
358-
<serverId>ossrh</serverId>
359-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
360-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
362+
<publishingServerId>central</publishingServerId>
363+
<tokenAuth>true</tokenAuth>
364+
<autoPublish>true</autoPublish>
361365
</configuration>
362366
</plugin>
363367
</plugins>

0 commit comments

Comments
 (0)