Skip to content

Commit a8b3536

Browse files
authored
Migrate deployment to Sonatype Central Portal (#687)
* Replace OSSRH deployment configuration with Central Portal * Update maven-deploy workflow to use central server credentials * Add central-publishing-maven-plugin for artifact publishing * Remove legacy OSSRH snapshot repository configuration * Update CI/CD environment variables for new authentication method
1 parent a9be77a commit a8b3536

2 files changed

Lines changed: 18 additions & 10 deletions

File tree

.github/workflows/maven-deploy.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ jobs:
4545
java-version: 11
4646
distribution: 'temurin'
4747
gpg-private-key: ${{ secrets.GPG_KEY }}
48-
server-id: ossrh
49-
server-username: OSSRH_USER
50-
server-password: OSSRH_TOKEN
48+
server-id: central
49+
server-username: CENTRAL_PORTAL_USERNAME
50+
server-password: CENTRAL_PORTAL_PASSWORD
5151
- name: Cache local Maven repository
5252
uses: gantsign/maven-periodic-cache-action@v1
5353
with:
@@ -61,15 +61,15 @@ jobs:
6161
- name: Deploy with Maven
6262
run: |
6363
./mvnw deploy \
64-
-P publish-artifacts,sign-artifacts,ossrh-deploy \
64+
-P publish-artifacts,sign-artifacts \
6565
"-Drevision=${GIT_TAG:-development-SNAPSHOT}" \
6666
-DskipTests \
6767
-Dinvoker.skip=true \
6868
--batch-mode \
6969
--show-version \
7070
-Dstyle.color=always
7171
env:
72-
OSSRH_USER: ${{ secrets.OSSRH_USER }}
73-
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
72+
CENTRAL_PORTAL_USERNAME: ${{ secrets.CENTRAL_PORTAL_USERNAME }}
73+
CENTRAL_PORTAL_PASSWORD: ${{ secrets.CENTRAL_PORTAL_PASSWORD }}
7474
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }}
7575
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

pom.xml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
<doxia.version>1.12.0</doxia.version>
5252
<guice.version>4.2.0</guice.version>
5353
<jacoco-maven-plugin.version>0.8.7</jacoco-maven-plugin.version>
54+
<central-publishing-maven-plugin.version>0.10.0</central-publishing-maven-plugin.version>
5455
<java.require.version>11</java.require.version>
5556
<jdeps.multiRelease>11</jdeps.multiRelease>
5657
<kotlin.version>2.1.0</kotlin.version>
@@ -881,10 +882,6 @@
881882
</ciManagement>
882883

883884
<distributionManagement>
884-
<snapshotRepository>
885-
<id>ossrh</id>
886-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
887-
</snapshotRepository>
888885
<site>
889886
<id>github-pages-site</id>
890887
<name>Deployment through Apache Maven SCM Publish Plugin</name>
@@ -922,6 +919,17 @@
922919
</execution>
923920
</executions>
924921
</plugin>
922+
<plugin>
923+
<groupId>org.sonatype.central</groupId>
924+
<artifactId>central-publishing-maven-plugin</artifactId>
925+
<version>${central-publishing-maven-plugin.version}</version>
926+
<extensions>true</extensions>
927+
<configuration>
928+
<publishingServerId>central</publishingServerId>
929+
<autoPublish>true</autoPublish>
930+
<waitUntil>published</waitUntil>
931+
</configuration>
932+
</plugin>
925933
</plugins>
926934
</build>
927935
</profile>

0 commit comments

Comments
 (0)