Skip to content

Commit 5e6b740

Browse files
committed
Migrate from OSSRH to Central Publisher Portal
1 parent 7616e19 commit 5e6b740

File tree

2 files changed

+15
-25
lines changed

2 files changed

+15
-25
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ jobs:
1919
- name: Set up Maven Central repository
2020
uses: actions/setup-java@v4
2121
with:
22-
java-version: 11
22+
java-version: 24
2323
distribution: 'zulu'
24-
server-id: ossrh
25-
server-username: MAVEN_USERNAME # env variable to use for username in release
26-
server-password: MAVEN_PASSWORD # env variable to use for password in release
24+
# See https://central.sonatype.org/publish/publish-portal-maven/
25+
server-id: central
26+
server-username: CENTRAL_USERNAME # env variable to use for username in release
27+
server-password: CENTRAL_PASSWORD # env variable to use for password in release
2728
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
2829
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable to use for passphrase in release
2930

@@ -37,6 +38,6 @@ jobs:
3738
mvn -B -Dusername=${{ secrets.GH_USERNAME }} -Dpassword=${{ secrets.GH_ACCESS_TOKEN }} release:prepare
3839
mvn -B release:perform
3940
env:
40-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
41-
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
41+
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
42+
CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }}
4243
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

pom.xml

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -85,22 +85,22 @@
8585
</pluginManagement>
8686

8787
<plugins>
88+
<!-- https://central.sonatype.org/publish/publish-portal-maven/ -->
8889
<plugin>
89-
<groupId>org.sonatype.plugins</groupId>
90-
<artifactId>nexus-staging-maven-plugin</artifactId>
91-
<version>1.6.13</version>
90+
<groupId>org.sonatype.central</groupId>
91+
<artifactId>central-publishing-maven-plugin</artifactId>
92+
<version>0.8.0</version>
9293
<extensions>true</extensions>
9394
<configuration>
94-
<serverId>ossrh</serverId>
95-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
96-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
97-
<stagingProgressTimeoutMinutes>10</stagingProgressTimeoutMinutes>
95+
<publishingServerId>central</publishingServerId>
96+
<autoPublish>true</autoPublish>
97+
<waitUntil>published</waitUntil>
9898
</configuration>
9999
</plugin>
100100
<plugin>
101101
<groupId>org.apache.maven.plugins</groupId>
102102
<artifactId>maven-release-plugin</artifactId>
103-
<version>3.0.1</version>
103+
<version>3.1.1</version>
104104
<configuration>
105105
<autoVersionSubmodules>true</autoVersionSubmodules>
106106
<useReleaseProfile>false</useReleaseProfile>
@@ -307,15 +307,4 @@
307307
<tag>HEAD</tag>
308308
</scm>
309309

310-
<distributionManagement>
311-
<snapshotRepository>
312-
<id>ossrh</id>
313-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
314-
</snapshotRepository>
315-
<repository>
316-
<id>ossrh</id>
317-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
318-
</repository>
319-
</distributionManagement>
320-
321310
</project>

0 commit comments

Comments
 (0)