Skip to content

Commit 81f6c68

Browse files
committed
Configure project to publish to Central Portal
OSSRH reaches EOL on June 30th, 2025.
1 parent 5d9d5e1 commit 81f6c68

File tree

5 files changed

+30
-42
lines changed

5 files changed

+30
-42
lines changed

.github/workflows/publish-snapshot.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ jobs:
1414
distribution: 'zulu'
1515
java-version: '21'
1616
cache: 'maven'
17-
server-id: ossrh
17+
server-id: central
1818
server-username: MAVEN_USERNAME
1919
server-password: MAVEN_PASSWORD
2020
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
2121
gpg-passphrase: MAVEN_GPG_PASSPHRASE
2222
- name: Publish snapshot
2323
run: ./mvnw clean deploy -Psnapshots -DskipITs -DskipTests
2424
env:
25-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
26-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
25+
MAVEN_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
26+
MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN }}
2727
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
distribution: 'temurin'
1818
java-version: '11'
1919
cache: 'maven'
20-
server-id: ${{ env.maven_server_id }}
20+
server-id: central
2121
server-username: MAVEN_USERNAME
2222
server-password: MAVEN_PASSWORD
2323
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
@@ -28,8 +28,8 @@ jobs:
2828
git config user.email "[email protected]"
2929
ci/release-amqp-java-client.sh
3030
env:
31-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
32-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
31+
MAVEN_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
32+
MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN }}
3333
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
3434
- name: Checkout tls-gen
3535
uses: actions/checkout@v4

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
distribution: 'zulu'
2424
java-version: '21'
2525
cache: 'maven'
26-
server-id: ossrh
26+
server-id: central
2727
server-username: MAVEN_USERNAME
2828
server-password: MAVEN_PASSWORD
2929
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
@@ -53,8 +53,8 @@ jobs:
5353
- name: Publish snapshot
5454
run: ./mvnw clean deploy -Psnapshots -DskipITs -DskipTests
5555
env:
56-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
57-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
56+
MAVEN_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
57+
MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN }}
5858
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
5959
- name: Publish Documentation
6060
run: |

pom.xml

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,6 @@
489489
</executions>
490490
</plugin>
491491

492-
493492
<plugin>
494493
<groupId>com.diffplug.spotless</groupId>
495494
<artifactId>spotless-maven-plugin</artifactId>
@@ -598,6 +597,17 @@
598597
</executions>
599598
</plugin>
600599

600+
<plugin>
601+
<groupId>org.sonatype.central</groupId>
602+
<artifactId>central-publishing-maven-plugin</artifactId>
603+
<version>0.7.0</version>
604+
<extensions>true</extensions>
605+
<configuration>
606+
<publishingServerId>central</publishingServerId>
607+
<autoPublish>true</autoPublish>
608+
</configuration>
609+
</plugin>
610+
601611
<!-- must stay at the end to execute last -->
602612
<plugin>
603613
<groupId>org.apache.maven.plugins</groupId>
@@ -650,12 +660,6 @@
650660
<gpg.skip>false</gpg.skip>
651661
<spotbugs.skip>true</spotbugs.skip>
652662
</properties>
653-
<distributionManagement>
654-
<snapshotRepository>
655-
<id>ossrh</id>
656-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
657-
</snapshotRepository>
658-
</distributionManagement>
659663
</profile>
660664

661665
<profile>
@@ -665,29 +669,6 @@
665669
<gpg.skip>false</gpg.skip>
666670
<spotbugs.skip>true</spotbugs.skip>
667671
</properties>
668-
<build>
669-
<plugins>
670-
671-
<plugin>
672-
<groupId>org.sonatype.plugins</groupId>
673-
<artifactId>nexus-staging-maven-plugin</artifactId>
674-
<version>${nexus-staging-maven-plugin.version}</version>
675-
<extensions>true</extensions>
676-
<configuration>
677-
<serverId>ossrh</serverId>
678-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
679-
<autoReleaseAfterClose>false</autoReleaseAfterClose>
680-
<stagingProgressTimeoutMinutes>20</stagingProgressTimeoutMinutes>
681-
</configuration>
682-
</plugin>
683-
</plugins>
684-
</build>
685-
<distributionManagement>
686-
<repository>
687-
<id>ossrh</id>
688-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
689-
</repository>
690-
</distributionManagement>
691672
</profile>
692673

693674
</profiles>

src/docs/asciidoc/index.adoc

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ With Maven:
6767
<repositories>
6868
6969
<repository>
70-
<id>ossrh</id>
71-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
70+
<id>central-portal-snapshots</id>
71+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
7272
<snapshots><enabled>true</enabled></snapshots>
7373
<releases><enabled>false</enabled></releases>
7474
</repository>
@@ -82,7 +82,14 @@ With Gradle:
8282
[source,groovy,subs="attributes,specialcharacters"]
8383
----
8484
repositories {
85-
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
85+
maven {
86+
name = 'Central Portal Snapshots'
87+
url = 'https://central.sonatype.com/repository/maven-snapshots/'
88+
// Only search this repository for the specific dependency
89+
content {
90+
includeModule("{project-group-id}", "{project-artifact-id}")
91+
}
92+
}
8693
mavenCentral()
8794
}
8895
----

0 commit comments

Comments
 (0)