Skip to content

Commit b38b20b

Browse files
committed
Change a publish plugin for Maven Central
1 parent c215cdc commit b38b20b

File tree

2 files changed

+37
-21
lines changed

2 files changed

+37
-21
lines changed

.github/workflows/release-workflow.yml

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ jobs:
301301
distribution: 'temurin'
302302
java-version: '21'
303303
server-id: ossrh
304-
server-username: OSSRH_USERNAME
305-
server-password: OSSRH_TOKEN
304+
server-username: CENTRAL_SONATYPE_TOKEN_USERNAME
305+
server-password: CENTRAL_SONATYPE_TOKEN_PASSWORD
306306
overwrite-settings: false
307307

308308
# Required to run the mvn:versions, since enforcer plugin
@@ -316,6 +316,15 @@ jobs:
316316
github-token: ${{ secrets.GITHUB_TOKEN }}
317317
native-image-job-reports: 'false'
318318

319+
- name: Configure GPG
320+
uses: actions/setup-java@v4
321+
with:
322+
distribution: 'temurin'
323+
java-version: '21'
324+
gpg-private-key: GPG_PRIVATE_KEY
325+
gpg-passphrase: GPG_PASSPHRASE
326+
overwrite-settings: false
327+
319328
- name: Fetch Linux Artifacts
320329
uses: actions/download-artifact@v4
321330
with:
@@ -419,23 +428,23 @@ jobs:
419428
# is the undocumented rc-list-profiles command of the
420429
# nexus-staging-maven-plugin:
421430
# mvn org.sonatype.plugins:nexus-staging-maven-plugin:1.6.13:rc-list-profiles -DnexusUrl=https://oss.sonatype.org/ -DserverId=ossrh
422-
- name: Release to OSSRH/Maven Central
431+
- name: Release to Maven Central
423432
if: ${{ !contains( github.event.inputs.release_version, '-M' ) }}
424433
run: |
425-
mkdir deploy
426-
mv nexus-staging deploy
427-
cd deploy
428-
mvn org.sonatype.plugins:nexus-staging-maven-plugin:1.6.13:deploy-staged-repository \
429-
-DnexusUrl=https://oss.sonatype.org/ \
430-
-DserverId=ossrh \
431-
-DrepositoryDirectory=nexus-staging \
432-
-DstagingProfileId=7e73217781f2e
434+
mvn -B -pl '!org.eclipse.esmf:samm-cli' clean deploy -Psign
435+
# run: |
436+
# mkdir deploy
437+
# mv nexus-staging deploy
438+
# cd deploy
439+
# mvn org.sonatype.plugins:nexus-staging-maven-plugin:1.6.13:deploy-staged-repository \
440+
# -DnexusUrl=https://oss.sonatype.org/ \
441+
# -DserverId=ossrh \
442+
# -DrepositoryDirectory=nexus-staging \
443+
# -DstagingProfileId=7e73217781f2e
433444
env:
434-
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
435-
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
436-
# Workaround for https://issues.sonatype.org/browse/OSSRH-66257
437-
# as described in https://stackoverflow.com/a/70157413
438-
MAVEN_OPTS: --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED
445+
CENTRAL_USERNAME: ${{ secrets.CENTRAL_SONATYPE_TOKEN_USERNAME }}
446+
CENTRAL_TOKEN: ${{ secrets.CENTRAL_SONATYPE_TOKEN_PASSWORD }}
447+
PGP_KEY_PASSWORD: ${{ secrets.GPG_PRIVATE_KEY }}
439448

440449
# Milestone release: Write settings to deploy to Github repo
441450
- name: Write settings.xml

documentation/pom.xml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,19 @@
138138
</executions>
139139
</plugin>
140140

141+
<!-- <plugin>-->
142+
<!-- <groupId>org.sonatype.plugins</groupId>-->
143+
<!-- <artifactId>nexus-staging-maven-plugin</artifactId>-->
144+
<!-- <configuration>-->
145+
<!-- <skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>-->
146+
<!-- </configuration>-->
147+
<!-- </plugin>-->
148+
141149
<plugin>
142-
<groupId>org.sonatype.plugins</groupId>
143-
<artifactId>nexus-staging-maven-plugin</artifactId>
144-
<configuration>
145-
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
146-
</configuration>
150+
<groupId>org.sonatype.central</groupId>
151+
<artifactId>central-publishing-maven-plugin</artifactId>
152+
<version>0.7.0</version>
153+
<extensions>true</extensions>
147154
</plugin>
148155

149156
<plugin>

0 commit comments

Comments
 (0)