Skip to content

Commit c13d6aa

Browse files
authored
1 parent e7b9892 commit c13d6aa

File tree

4 files changed

+49
-40
lines changed

4 files changed

+49
-40
lines changed

.github/workflows/publish-release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
7575
deploy-to-maven-central:
7676
needs: check-version
77-
# use environment maven-central, where secrets are configured for OSSRH_*
77+
# use environment maven-central, where secrets are configured for MAVEN_CENTRAL_PORTAL_*
7878
environment:
7979
name: maven-central
8080
url: https://repo.maven.apache.org/maven2/net/sourceforge/pmd/pmd-build-tools-config/
@@ -92,15 +92,15 @@ jobs:
9292
distribution: 'temurin'
9393
java-version: '11'
9494
cache: 'maven'
95-
server-id: ossrh
95+
server-id: central
9696
server-username: MAVEN_USERNAME
9797
server-password: MAVEN_PASSWORD
9898
gpg-passphrase: MAVEN_GPG_PASSPHRASE
9999
gpg-private-key: ${{ secrets.PMD_CI_GPG_PRIVATE_KEY }}
100100
- name: Build and Publish
101101
env:
102-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
103-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
102+
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_PORTAL_USERNAME }}
103+
MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PORTAL_PASSWORD }}
104104
MAVEN_GPG_PASSPHRASE: ${{ secrets.PMD_CI_GPG_PASSPHRASE }}
105105
run: |
106106
./mvnw --show-version --errors --batch-mode \

.github/workflows/publish-snapshot.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ jobs:
6767
6868
deploy-to-maven-central:
6969
needs: check-version
70-
# use environment maven-central, where secrets are configured for OSSRH_*
70+
# use environment maven-central, where secrets are configured for MAVEN_CENTRAL_PORTAL_*
7171
environment:
7272
name: maven-central
73-
url: https://oss.sonatype.org/content/repositories/snapshots/net/sourceforge/pmd/pmd-build-tools-config/
73+
url: https://central.sonatype.com/service/rest/repository/browse/maven-snapshots/net/sourceforge/pmd/pmd-build-tools-config/
7474
runs-on: ubuntu-latest
7575
timeout-minutes: 20
7676
defaults:
@@ -85,15 +85,15 @@ jobs:
8585
distribution: 'temurin'
8686
java-version: '11'
8787
cache: 'maven'
88-
server-id: ossrh
88+
server-id: central
8989
server-username: MAVEN_USERNAME
9090
server-password: MAVEN_PASSWORD
9191
gpg-passphrase: MAVEN_GPG_PASSPHRASE
9292
gpg-private-key: ${{ secrets.PMD_CI_GPG_PRIVATE_KEY }}
9393
- name: Build and Publish
9494
env:
95-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
96-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
95+
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_PORTAL_USERNAME }}
96+
MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PORTAL_PASSWORD }}
9797
MAVEN_GPG_PASSPHRASE: ${{ secrets.PMD_CI_GPG_PASSPHRASE }}
9898
run: |
9999
./mvnw --show-version --errors --batch-mode \

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,8 @@ Don't forget to update the secret `PMD_CI_GPG_PRIVATE_KEY` with the renewed priv
796796
797797
### Nexus Staging Maven Plugin
798798
799+
⚠ This is deprecated, see <https://central.sonatype.org/news/20250326_ossrh_sunset/>
800+
799801
See <https://github.com/sonatype/nexus-maven-plugins/tree/master/staging/maven-plugin>.
800802
801803
This plugin is used, to upload maven artifacts to https://oss.sonatype.org/ and eventually to maven central

pom.xml

Lines changed: 38 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,6 @@
3232
<url>https://github.com/pmd/build-tools</url>
3333
<tag>HEAD</tag>
3434
</scm>
35-
<distributionManagement>
36-
<snapshotRepository>
37-
<id>ossrh</id>
38-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
39-
</snapshotRepository>
40-
<repository>
41-
<id>ossrh</id>
42-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
43-
</repository>
44-
</distributionManagement>
4535

4636
<properties>
4737
<project.build.outputTimestamp>2025-05-09T17:35:04Z</project.build.outputTimestamp>
@@ -202,9 +192,9 @@
202192
</configuration>
203193
</plugin>
204194
<plugin>
205-
<groupId>org.sonatype.plugins</groupId>
206-
<artifactId>nexus-staging-maven-plugin</artifactId>
207-
<version>1.7.0</version>
195+
<groupId>org.sonatype.central</groupId>
196+
<artifactId>central-publishing-maven-plugin</artifactId>
197+
<version>0.7.0</version>
208198
</plugin>
209199
</plugins>
210200
</pluginManagement>
@@ -280,31 +270,19 @@
280270
</executions>
281271
</plugin>
282272
<plugin>
283-
<groupId>org.sonatype.plugins</groupId>
284-
<artifactId>nexus-staging-maven-plugin</artifactId>
273+
<groupId>org.sonatype.central</groupId>
274+
<artifactId>central-publishing-maven-plugin</artifactId>
285275
<extensions>true</extensions>
286276
<configuration>
287-
<serverId>ossrh</serverId>
288-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
277+
<publishingServerId>central</publishingServerId>
278+
<autoPublish>true</autoPublish>
279+
<waitUntil>published</waitUntil>
280+
<deploymentName>${project.artifactId}</deploymentName>
289281
</configuration>
290282
</plugin>
291283
</plugins>
292284
</build>
293285

294-
<repositories>
295-
<repository>
296-
<id>sonatype-nexus-snapshots</id>
297-
<name>Sonatype Nexus Snapshots</name>
298-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
299-
<releases>
300-
<enabled>false</enabled>
301-
</releases>
302-
<snapshots>
303-
<enabled>true</enabled>
304-
</snapshots>
305-
</repository>
306-
</repositories>
307-
308286
<profiles>
309287
<profile>
310288
<id>sign</id>
@@ -330,6 +308,35 @@
330308
</plugins>
331309
</build>
332310
</profile>
311+
<profile>
312+
<id>central-portal-snapshots</id>
313+
<repositories>
314+
<repository>
315+
<name>Central Portal Snapshots</name>
316+
<id>central-portal-snapshots</id>
317+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
318+
<releases>
319+
<enabled>false</enabled>
320+
</releases>
321+
<snapshots>
322+
<enabled>true</enabled>
323+
</snapshots>
324+
</repository>
325+
</repositories>
326+
<pluginRepositories>
327+
<pluginRepository>
328+
<name>Central Portal Snapshots</name>
329+
<id>central-portal-snapshots</id>
330+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
331+
<releases>
332+
<enabled>false</enabled>
333+
</releases>
334+
<snapshots>
335+
<enabled>true</enabled>
336+
</snapshots>
337+
</pluginRepository>
338+
</pluginRepositories>
339+
</profile>
333340
</profiles>
334341
</project>
335342

0 commit comments

Comments
 (0)