Skip to content

Commit 70e94bf

Browse files
authored
Migrate artifact publishing to Maven Central Portal (#1090)
Nexus OSSRH publishing was shutdown in June 2025. Publish to the Maven Central Portal instead. https://central.sonatype.org/pages/ossrh-eol
1 parent 58d83cd commit 70e94bf

File tree

4 files changed

+18
-30
lines changed

4 files changed

+18
-30
lines changed

.github/maven/settings.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
<password>${env.GITHUB_TOKEN}</password>
77
</server>
88
<server>
9-
<id>ossrh</id>
10-
<username>${env.OSSRH_USERNAME}</username>
11-
<password>${env.OSSRH_PASSWORD}</password>
9+
<id>central</id>
10+
<username>${env.CENTRAL_USERNAME}</username>
11+
<password>${env.CENTRAL_PASSWORD}</password>
1212
</server>
1313
</servers>
1414

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ jobs:
9191
${{ runner.os }}-maven-
9292
9393
- name: Release
94-
run: ./mvnw --batch-mode --no-transfer-progress --show-version --settings .github/maven/settings.xml --activate-profiles ossrh release:prepare release:perform
94+
run: ./mvnw --batch-mode --no-transfer-progress --show-version --settings .github/maven/settings.xml --activate-profiles central-publish release:prepare release:perform
9595
env:
9696
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97-
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
98-
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
97+
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
98+
CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }}

PROCESS.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,10 @@ and uses the `maven-release-plugin` to perform the release, which then:
4444
2. Creates the git tag, and builds the artifacts
4545
3. Uses the `maven-gpg-plugin` to sign the artifacts with [this GPG signing key](http://keyserver.ubuntu.com/pks/lookup?search=0x794038C5C4DF6A3F&fingerprint=on&op=index)
4646
using the [`GPG_KEY` and `GPG_PASSPHRASE` secrets](https://github.com/logfellow/logstash-logback-encoder/settings/secrets/actions)
47-
4. Uses the `nexus-staging-maven-plugin` to:
48-
1. Deploy the artifact to a staging repository hosted at https://oss.sonatype.org/
49-
using the [`OSSRH_USERNAME` and `OSSRH_PASSWORD` secrets](https://github.com/logfellow/logstash-logback-encoder/settings/secrets/actions)
50-
2. Automatically [release](https://central.sonatype.org/pages/releasing-the-deployment.html) the staging repository if no errors occur.
51-
* After the staging repository is released, the new artifacts will eventually propagate to maven central.
47+
4. Uses the `central-publishing-maven-plugin` to:
48+
1. Upload the artifact to https://central.sonatype.com/
49+
using the [`CENTRAL_USERNAME` and `CENTRAL_PASSWORD` secrets](https://github.com/logfellow/logstash-logback-encoder/settings/secrets/actions)
50+
2. Automatically [publish](https://central.sonatype.org/pages/releasing-the-deployment.html) to maven central if no errors occur.
5251
5. Bumps the version to the next `-SNAPSHOT` version.
5352

5453
After releasing, create a [release](https://github.com/logfellow/logstash-logback-encoder/releases) for the tag

pom.xml

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939

4040
<!-- maven plugins -->
4141
<build-helper-maven-plugin.version>3.6.1</build-helper-maven-plugin.version>
42+
<central-publishing-maven-plugin.version>0.9.0</central-publishing-maven-plugin.version>
4243
<extra-enforcer-rules.version>1.11.0</extra-enforcer-rules.version>
4344
<flatten-maven-plugin.version>1.7.3</flatten-maven-plugin.version>
4445
<jacoco-maven-plugin.version>0.8.13</jacoco-maven-plugin.version>
@@ -57,7 +58,6 @@
5758
<maven-shade-plugin.version>3.6.1</maven-shade-plugin.version>
5859
<maven-source-plugin.version>3.3.1</maven-source-plugin.version>
5960
<maven-surefire-plugin.version>3.5.4</maven-surefire-plugin.version>
60-
<nexus-staging-maven-plugin.version>1.7.0</nexus-staging-maven-plugin.version>
6161
<xml-maven-plugin.version>1.1.0</xml-maven-plugin.version>
6262

6363
<checkstyle.version>12.0.0</checkstyle.version>
@@ -651,7 +651,7 @@
651651
</build>
652652
<profiles>
653653
<profile>
654-
<id>ossrh</id>
654+
<id>central-publish</id>
655655
<build>
656656
<plugins>
657657
<plugin>
@@ -668,14 +668,14 @@
668668
</executions>
669669
</plugin>
670670
<plugin>
671-
<groupId>org.sonatype.plugins</groupId>
672-
<artifactId>nexus-staging-maven-plugin</artifactId>
673-
<version>${nexus-staging-maven-plugin.version}</version>
671+
<groupId>org.sonatype.central</groupId>
672+
<artifactId>central-publishing-maven-plugin</artifactId>
673+
<version>${central-publishing-maven-plugin.version}</version>
674674
<extensions>true</extensions>
675675
<configuration>
676-
<serverId>ossrh</serverId>
677-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
678-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
676+
<publishingServerId>central</publishingServerId>
677+
<autoPublish>true</autoPublish>
678+
<waitUntil>published</waitUntil>
679679
</configuration>
680680
</plugin>
681681
</plugins>
@@ -788,15 +788,4 @@
788788
</profile>
789789
</profiles>
790790

791-
<distributionManagement>
792-
<snapshotRepository>
793-
<id>ossrh</id>
794-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
795-
</snapshotRepository>
796-
<repository>
797-
<id>ossrh</id>
798-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
799-
</repository>
800-
</distributionManagement>
801-
802791
</project>

0 commit comments

Comments
 (0)