Skip to content

Commit e052cef

Browse files
[RelEng] Migrate publishing to new Maven Central Portal
Replace the previous nexus-staging-maven-plugin by the new central-publishing-maven-plugin
1 parent 57c6ee1 commit e052cef

4 files changed

Lines changed: 28 additions & 28 deletions

File tree

.github/actions/setup-java-for-deployment/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ runs:
1616
java-version: '17'
1717
distribution: 'temurin'
1818
cache: 'maven' # Cache Maven dependencies between workflow runs
19-
# Properties for deployment to OSSRH:
20-
server-id: ossrh
19+
# Properties for deployment to Maven Central Portal:
20+
server-id: central-portal
2121
server-username: MAVEN_USERNAME
2222
server-password: MAVEN_PASSWORD
2323
# Properties for gpg signing:

.github/workflows/maven-build-master-and-publish-snapshot.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This workflow will build a Java project with Maven and will publish snapshot versions to the OSSRH Snapshots repository
1+
# This workflow will build a Java project with Maven and will publish snapshot versions to the Central Portal Snapshots repository
22
# For more information see:
33
# https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-Apache-Maven
44
# https://docs.github.com/en/actions/publishing-packages/publishing-java-packages-with-maven
@@ -27,8 +27,8 @@ jobs:
2727

2828
- run: mvn deploy -Ppublish-to-maven-central
2929
working-directory: symja_android_library
30-
# Deployment of all modules is deferred to the last module by nexus-staging-maven-plugin
30+
# Deployment of all modules is deferred to the last module by central-publishing-maven-plugin
3131
env:
32-
MAVEN_USERNAME: ${{ secrets.OSSRH_TOKEN_USERNAME }}
33-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN_PASSWORD }}
32+
MAVEN_USERNAME: ${{ secrets.CENTRAL_PORTAL_TOKEN_USERNAME }}
33+
MAVEN_PASSWORD: ${{ secrets.CENTRAL_PORTAL_TOKEN_PASSWORD }}
3434
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

.github/workflows/maven-perform-release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ jobs:
6767

6868
- run: mvn release:perform -DlocalCheckout=true
6969
working-directory: symja_android_library
70-
# Deployment of all modules is deferred to the last module by nexus-staging-maven-plugin
70+
# Deployment of all modules is deferred to the last module by central-publishing-maven-plugin
7171
env:
72-
MAVEN_USERNAME: ${{ secrets.OSSRH_TOKEN_USERNAME }}
73-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN_PASSWORD }}
72+
MAVEN_USERNAME: ${{ secrets.CENTRAL_PORTAL_TOKEN_USERNAME }}
73+
MAVEN_PASSWORD: ${{ secrets.CENTRAL_PORTAL_TOKEN_PASSWORD }}
7474
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
7575

7676
- name: Publish release commits and tag to master
@@ -86,7 +86,7 @@ jobs:
8686
tag_name: ${{ env.release_tag }}
8787
draft: false
8888
prerelease: false
89-
files: ./symja_android_library/target/checkout/symja_android_library/target/nexus-staging/**/*.jar
89+
files: ./symja_android_library/target/checkout/symja_android_library/target/central-deferred/**/*.jar
9090
body: |
9191
We are pleased to announce the release of Symja ${{ env.release_version }}.
9292

symja_android_library/pom.xml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,14 @@
7474
</issueManagement>
7575
<distributionManagement>
7676
<repository>
77-
<id>ossrh</id>
78-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
77+
<id>central-portal</id>
78+
<url>https://repo.maven.apache.org/maven2</url>
79+
<!-- Only the URL where release artifacts will be available for
80+
download, for upload the Central Portal Upload service is used. -->
7981
</repository>
8082
<snapshotRepository>
81-
<id>ossrh</id>
82-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
83+
<id>central-portal</id>
84+
<url>https://central.sonatype.com/repository/maven-snapshots</url>
8385
</snapshotRepository>
8486
</distributionManagement>
8587

@@ -566,12 +568,17 @@
566568
<version>3.6.3</version>
567569
</plugin>
568570
<plugin>
569-
<groupId>org.sonatype.plugins</groupId>
570-
<artifactId>nexus-staging-maven-plugin</artifactId>
571-
<version>1.7.0</version>
571+
<groupId>org.sonatype.central</groupId>
572+
<artifactId>central-publishing-maven-plugin</artifactId>
573+
<version>0.10.0</version>
574+
<extensions>true</extensions>
572575
<configuration>
573-
<serverId>ossrh</serverId>
574-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
576+
<!-- See also: https://central.sonatype.org/publish/publish-portal-maven/#stagingdirectory -->
577+
<autoPublish>false</autoPublish>
578+
<skipPublishing>${deployment.suppress}</skipPublishing>
579+
<deploymentName>MathEclipse-${project.version}</deploymentName>
580+
<publishingServerId>central-portal</publishingServerId>
581+
<waitUntil>validated</waitUntil>
575582
</configuration>
576583
</plugin>
577584
</plugins>
@@ -730,15 +737,8 @@
730737
</executions>
731738
</plugin>
732739
<plugin>
733-
<groupId>org.sonatype.plugins</groupId>
734-
<artifactId>nexus-staging-maven-plugin</artifactId>
735-
<extensions>true</extensions>
736-
<configuration>
737-
<skipNexusStagingDeployMojo>${deployment.suppress}</skipNexusStagingDeployMojo>
738-
<!-- Documentation:
739-
https://github.com/sonatype/nexus-maven-plugins/blob/master/staging/maven-plugin/README.md-->
740-
<autoReleaseAfterClose>false</autoReleaseAfterClose>
741-
</configuration>
740+
<groupId>org.sonatype.central</groupId>
741+
<artifactId>central-publishing-maven-plugin</artifactId>
742742
</plugin>
743743
</plugins>
744744
</build>

0 commit comments

Comments
 (0)