Skip to content

Commit a84152e

Browse files
committed
Configure project to publish to Central Portal
OSSRH reaches EOL on June 30th, 2025. (cherry picked from commit 1b0110e) Conflicts: src/test/java/SanityCheck.java
1 parent 27032f4 commit a84152e

File tree

5 files changed

+23
-155
lines changed

5 files changed

+23
-155
lines changed

.github/workflows/publish-snapshot.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
distribution: 'zulu'
1919
java-version: '21'
2020
cache: 'maven'
21-
server-id: ossrh
21+
server-id: central
2222
server-username: MAVEN_USERNAME
2323
server-password: MAVEN_PASSWORD
2424
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
@@ -28,6 +28,6 @@ jobs:
2828
- name: Publish snapshot
2929
run: ./mvnw clean deploy -Psnapshots -DskipITs -DskipTests --no-transfer-progress
3030
env:
31-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
32-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
33-
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
31+
MAVEN_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
32+
MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN }}
33+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

.github/workflows/release.yml

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ jobs:
99

1010
steps:
1111
- uses: actions/checkout@v4
12-
- name: Evaluate release type
13-
run: ci/evaluate-release.sh
1412
- name: Set up Python
1513
uses: actions/setup-python@v5
1614
with:
@@ -21,30 +19,19 @@ jobs:
2119
distribution: 'temurin'
2220
java-version: '8'
2321
cache: 'maven'
24-
server-id: ${{ env.maven_server_id }}
22+
server-id: central
2523
server-username: MAVEN_USERNAME
2624
server-password: MAVEN_PASSWORD
2725
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
2826
gpg-passphrase: MAVEN_GPG_PASSPHRASE
2927
- name: Get dependencies
3028
run: make deps
31-
- name: Release AMQP Java Client (GA)
32-
if: ${{ env.ga_release == 'true' }}
29+
- name: Release AMQP Java Client
3330
run: |
3431
git config user.name "rabbitmq-ci"
3532
git config user.email "[email protected]"
3633
ci/release-java-client.sh
3734
env:
38-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
39-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
35+
MAVEN_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
36+
MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN }}
4037
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
41-
- name: Release AMQP Java Client (Milestone/RC)
42-
if: ${{ env.ga_release != 'true' }}
43-
run: |
44-
git config user.name "rabbitmq-ci"
45-
git config user.email "[email protected]"
46-
ci/release-java-client.sh
47-
env:
48-
MAVEN_USERNAME: ''
49-
MAVEN_PASSWORD: ${{ secrets.PACKAGECLOUD_TOKEN }}
50-
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
distribution: 'zulu'
3131
java-version: '21'
3232
cache: 'maven'
33-
server-id: ossrh
33+
server-id: central
3434
server-username: MAVEN_USERNAME
3535
server-password: MAVEN_PASSWORD
3636
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
@@ -62,6 +62,6 @@ jobs:
6262
if: ${{ github.event_name != 'pull_request' }}
6363
run: ./mvnw clean deploy -Psnapshots -DskipITs -DskipTests --no-transfer-progress
6464
env:
65-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
66-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
65+
MAVEN_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
66+
MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN }}
6767
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

ci/evaluate-release.sh

Lines changed: 0 additions & 14 deletions
This file was deleted.

pom.xml

Lines changed: 12 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,8 @@
8686
<maven.gpg.plugin.version>3.2.7</maven.gpg.plugin.version>
8787
<maven.jar.plugin.version>3.4.2</maven.jar.plugin.version>
8888
<maven.bundle.plugin.version>5.1.9</maven.bundle.plugin.version>
89-
<maven.packagecloud.wagon.version>0.0.6</maven.packagecloud.wagon.version>
90-
<nexus-staging-maven-plugin.version>1.7.0</nexus-staging-maven-plugin.version>
9189
<checksum.maven.plugin.version>1.11</checksum.maven.plugin.version>
90+
<central-publishing-maven-plugin.version>0.7.0</central-publishing-maven-plugin.version>
9291
<jshell-maven-plugin.version>1.4</jshell-maven-plugin.version>
9392
<spotless.version>2.44.5</spotless.version>
9493
<google-java-format.version>1.19.2</google-java-format.version>
@@ -316,12 +315,6 @@
316315
</plugin>
317316
</plugins>
318317
</build>
319-
<distributionManagement>
320-
<snapshotRepository>
321-
<id>ossrh</id>
322-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
323-
</snapshotRepository>
324-
</distributionManagement>
325318
</profile>
326319

327320
<!--
@@ -332,19 +325,6 @@
332325
<build>
333326
<plugins>
334327

335-
<plugin>
336-
<groupId>org.sonatype.plugins</groupId>
337-
<artifactId>nexus-staging-maven-plugin</artifactId>
338-
<version>${nexus-staging-maven-plugin.version}</version>
339-
<extensions>true</extensions>
340-
<configuration>
341-
<serverId>ossrh</serverId>
342-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
343-
<autoReleaseAfterClose>false</autoReleaseAfterClose>
344-
<stagingProgressTimeoutMinutes>20</stagingProgressTimeoutMinutes>
345-
</configuration>
346-
</plugin>
347-
348328
<plugin>
349329
<groupId>org.apache.maven.plugins</groupId>
350330
<artifactId>maven-javadoc-plugin</artifactId>
@@ -383,97 +363,8 @@
383363
</plugin>
384364
</plugins>
385365
</build>
386-
<distributionManagement>
387-
<repository>
388-
<id>ossrh</id>
389-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
390-
</repository>
391-
</distributionManagement>
392366
</profile>
393367

394-
<!--
395-
The "milestone" Maven profile is used to push release artifacts to the
396-
PackageCloud Milestones Maven Repository.
397-
-->
398-
<profile>
399-
<id>milestone</id>
400-
<build>
401-
<plugins>
402-
<plugin>
403-
<groupId>org.apache.maven.plugins</groupId>
404-
<artifactId>maven-javadoc-plugin</artifactId>
405-
<version>${maven.javadoc.plugin.version}</version>
406-
<configuration>
407-
<additionalOptions>${javadoc.opts}</additionalOptions>
408-
<additionalJOption>${javadoc.joption}</additionalJOption>
409-
<quiet>true</quiet>
410-
<source>8</source>
411-
</configuration>
412-
<executions>
413-
<execution>
414-
<goals>
415-
<goal>jar</goal>
416-
</goals>
417-
</execution>
418-
</executions>
419-
</plugin>
420-
421-
<plugin>
422-
<groupId>net.nicoulaj.maven.plugins</groupId>
423-
<artifactId>checksum-maven-plugin</artifactId>
424-
<version>${checksum.maven.plugin.version}</version>
425-
<executions>
426-
<execution>
427-
<id>sign-artifacts</id>
428-
<phase>package</phase>
429-
<goals>
430-
<goal>files</goal>
431-
</goals>
432-
<configuration>
433-
<fileSets>
434-
<fileSet>
435-
<directory>${project.build.directory}</directory>
436-
<includes>
437-
<include>*.jar</include>
438-
<include>*.pom</include>
439-
</includes>
440-
</fileSet>
441-
</fileSets>
442-
<algorithms>
443-
<algorithm>MD5</algorithm>
444-
<algorithm>SHA-1</algorithm>
445-
</algorithms>
446-
</configuration>
447-
</execution>
448-
</executions>
449-
</plugin>
450-
451-
<plugin>
452-
<groupId>org.apache.maven.plugins</groupId>
453-
<artifactId>maven-gpg-plugin</artifactId>
454-
<version>${maven.gpg.plugin.version}</version>
455-
<executions>
456-
<execution>
457-
<id>sign-artifacts</id>
458-
<phase>package</phase>
459-
<goals>
460-
<goal>sign</goal>
461-
</goals>
462-
<configuration>
463-
<keyname>${gpg.keyname}</keyname>
464-
</configuration>
465-
</execution>
466-
</executions>
467-
</plugin>
468-
</plugins>
469-
</build>
470-
<distributionManagement>
471-
<repository>
472-
<id>packagecloud-rabbitmq-maven-milestones</id>
473-
<url>packagecloud+https://packagecloud.io/rabbitmq/maven-milestones</url>
474-
</repository>
475-
</distributionManagement>
476-
</profile>
477368
<profile>
478369
<id>mockito-4-on-java-8</id>
479370
<activation>
@@ -907,14 +798,18 @@
907798
</configuration>
908799
</plugin>
909800

801+
<plugin>
802+
<groupId>org.sonatype.central</groupId>
803+
<artifactId>central-publishing-maven-plugin</artifactId>
804+
<version>${central-publishing-maven-plugin.version}</version>
805+
<extensions>true</extensions>
806+
<configuration>
807+
<publishingServerId>central</publishingServerId>
808+
<autoPublish>true</autoPublish>
809+
</configuration>
810+
</plugin>
811+
910812
</plugins>
911-
<extensions>
912-
<extension>
913-
<groupId>io.packagecloud.maven.wagon</groupId>
914-
<artifactId>maven-packagecloud-wagon</artifactId>
915-
<version>${maven.packagecloud.wagon.version}</version>
916-
</extension>
917-
</extensions>
918813
</build>
919814

920815
</project>

0 commit comments

Comments
 (0)