Skip to content

Commit e56206a

Browse files
committed
chore: update to Maven Central Portal publishing
1 parent ceacf83 commit e56206a

File tree

3 files changed

+22
-31
lines changed

3 files changed

+22
-31
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ updates:
1212
patterns:
1313
- "org.apache.maven.plugins:*"
1414
- "org.moditect:moditect-maven-plugin"
15-
- "org.sonatype.plugins:nexus-staging-maven-plugin"
15+
- "org.sonatype.central:central-publishing-maven-plugin"
1616
- "org.codehaus.mojo:build-helper-maven-plugin"
1717
test-dependencies:
1818
patterns:

.github/workflows/publish.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ jobs:
1818
java-version: 17
1919
distribution: 'temurin'
2020
cache: 'maven'
21-
server-id: ossrh
22-
server-username: OSSRH_USERNAME # env variable for username in deploy
23-
server-password: OSSRH_PASSWORD # env variable for password in deploy
21+
server-id: central
22+
server-username: CENTRAL_USERNAME # env variable for username in deploy
23+
server-password: CENTRAL_PASSWORD # env variable for password in deploy
2424
gpg-private-key: ${{ secrets.OSSRH_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
25-
gpg-passphrase: OSSRH_GPG_PASSPHRASE # env variable for GPG private key passphrase
25+
gpg-passphrase: CENTRAL_GPG_PASSPHRASE # env variable for GPG private key passphrase
2626
- name: Deploy to Maven Central
2727
env:
28-
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
29-
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
30-
OSSRH_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_PASSPHRASE }}
28+
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
29+
CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }}
30+
CENTRAL_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_PASSPHRASE }}
3131
run: mvn -B deploy -Pdeploy

pom.xml

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
<maven-source-plugin.version>3.3.1</maven-source-plugin.version>
5858
<maven-surefire-plugin.version>3.5.3</maven-surefire-plugin.version>
5959
<maven-shade-plugin.version>3.6.0</maven-shade-plugin.version>
60-
<nexus-staging-maven-plugin.version>1.7.0</nexus-staging-maven-plugin.version>
60+
<central-publishing-maven-plugin.version>0.7.0</central-publishing-maven-plugin.version>
6161
<moditect-maven-plugin.version>1.2.2.Final</moditect-maven-plugin.version>
6262

6363
<!-- Dependencies -->
@@ -73,17 +73,6 @@
7373
<moditect.module.name>de.sonallux.spotify</moditect.module.name>
7474
</properties>
7575

76-
<distributionManagement>
77-
<snapshotRepository>
78-
<id>ossrh</id>
79-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
80-
</snapshotRepository>
81-
<repository>
82-
<id>ossrh</id>
83-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
84-
</repository>
85-
</distributionManagement>
86-
8776
<build>
8877
<plugins>
8978
<plugin>
@@ -170,17 +159,6 @@
170159
<id>deploy</id>
171160
<build>
172161
<plugins>
173-
<plugin>
174-
<groupId>org.sonatype.plugins</groupId>
175-
<artifactId>nexus-staging-maven-plugin</artifactId>
176-
<version>${nexus-staging-maven-plugin.version}</version>
177-
<extensions>true</extensions>
178-
<configuration>
179-
<serverId>ossrh</serverId>
180-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
181-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
182-
</configuration>
183-
</plugin>
184162
<plugin>
185163
<groupId>org.apache.maven.plugins</groupId>
186164
<artifactId>maven-gpg-plugin</artifactId>
@@ -195,6 +173,19 @@
195173
</execution>
196174
</executions>
197175
</plugin>
176+
<plugin>
177+
<groupId>org.sonatype.central</groupId>
178+
<artifactId>central-publishing-maven-plugin</artifactId>
179+
<version>${central-publishing-maven-plugin.version}</version>
180+
<extensions>true</extensions>
181+
<configuration>
182+
<publishingServerId>central</publishingServerId>
183+
<!--
184+
<autoPublish>true</autoPublish>
185+
<waitUntil>published</waitUntil>
186+
-->
187+
</configuration>
188+
</plugin>
198189
</plugins>
199190
</build>
200191
</profile>

0 commit comments

Comments
 (0)