Skip to content

Commit 304a274

Browse files
feat: Migrate to Central Publisher Portal (#1128)
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 304a274

File tree

4 files changed

+12
-19
lines changed

4 files changed

+12
-19
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: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,6 @@
6969
<tag>HEAD</tag>
7070
</scm>
7171

72-
<distributionManagement>
73-
<snapshotRepository>
74-
<id>ossrh</id>
75-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
76-
</snapshotRepository>
77-
</distributionManagement>
78-
7972
<profiles>
8073
<profile>
8174
<id>devsite-apidocs</id>
@@ -350,14 +343,14 @@
350343

351344
<!-- Deploy Phase -->
352345
<plugin>
353-
<groupId>org.sonatype.plugins</groupId>
354-
<artifactId>nexus-staging-maven-plugin</artifactId>
355-
<version>1.7.0</version>
346+
<groupId>org.sonatype.central</groupId>
347+
<artifactId>central-publishing-maven-plugin</artifactId>
348+
<version>0.8.0</version>
356349
<extensions>true</extensions>
357350
<configuration>
358-
<serverId>ossrh</serverId>
359-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
360-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
351+
<publishingServerId>central</publishingServerId>
352+
<autoPublish>true</autoPublish>
353+
<waitUntil>published</waitUntil>
361354
</configuration>
362355
</plugin>
363356
</plugins>

0 commit comments

Comments
 (0)