Skip to content

Commit 974e5bd

Browse files
committed
chore: replace legacy ossrh deployment with new central repository
1 parent 3ce76e0 commit 974e5bd

2 files changed

Lines changed: 27 additions & 10 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
check-latest: true
6868

6969
# ID of the distributionManagement repository in the pom.xml file.
70-
server-id: 'sonatype-nexus-staging'
70+
server-id: 'central'
7171

7272
# Environment variable name for the username for authentication to the Apache Maven repository.
7373
server-username: MAVEN_USERNAME

pom.xml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,11 @@
5858
</scm>
5959

6060
<distributionManagement>
61-
<snapshotRepository>
62-
<id>sonatype-nexus-snapshots</id>
63-
<name>Sonatype Nexus Snapshots</name>
64-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
65-
</snapshotRepository>
6661
<repository>
67-
<id>sonatype-nexus-staging</id>
68-
<name>Nexus Release Repository</name>
69-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
70-
</repository>
62+
<id>central</id>
63+
<name>Sonatype Release Repository</name>
64+
<url>https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2</url>
65+
</repository>
7166
</distributionManagement>
7267

7368
<properties>
@@ -96,6 +91,7 @@
9691
<maven-deploy-plugin.version>3.1.4</maven-deploy-plugin.version>
9792
<maven-site-plugin.version>3.21.0</maven-site-plugin.version>
9893
<versions-maven-plugin.version>2.18.0</versions-maven-plugin.version>
94+
<central-publishing-maven-plugin.version>0.8.0</central-publishing-maven-plugin.version>
9995

10096
<!-- Project dependencies -->
10197
<slf4j.version>2.0.17</slf4j.version>
@@ -243,6 +239,9 @@
243239
<groupId>org.apache.maven.plugins</groupId>
244240
<artifactId>maven-deploy-plugin</artifactId>
245241
<version>${maven-deploy-plugin.version}</version>
242+
<configuration>
243+
<skip>true</skip>
244+
</configuration>
246245
</plugin>
247246
<plugin>
248247
<groupId>org.apache.maven.plugins</groupId>
@@ -357,6 +356,24 @@
357356
<id>release</id>
358357
<build>
359358
<plugins>
359+
<plugin>
360+
<groupId>org.sonatype.central</groupId>
361+
<artifactId>central-publishing-maven-plugin</artifactId>
362+
<inherited>false</inherited>
363+
<configuration>
364+
<publishingServerId>central</publishingServerId>
365+
</configuration>
366+
<executions>
367+
<execution>
368+
<id>publish-to-maven-central</id>
369+
<phase>deploy</phase>
370+
<goals>
371+
<goal>publish</goal>
372+
</goals>
373+
</execution>
374+
</executions>
375+
</plugin>
376+
360377
<plugin>
361378
<groupId>org.apache.maven.plugins</groupId>
362379
<artifactId>maven-gpg-plugin</artifactId>

0 commit comments

Comments
 (0)