Skip to content

Change a publish plugin for Maven Central #774

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 25 additions & 16 deletions .github/workflows/release-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ jobs:
distribution: 'temurin'
java-version: '21'
server-id: ossrh
server-username: OSSRH_USERNAME
server-password: OSSRH_TOKEN
server-username: CENTRAL_SONATYPE_TOKEN_USERNAME
server-password: CENTRAL_SONATYPE_TOKEN_PASSWORD
overwrite-settings: false

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

- name: Configure GPG
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
gpg-private-key: GPG_PRIVATE_KEY
gpg-passphrase: GPG_PASSPHRASE
overwrite-settings: false

- name: Fetch Linux Artifacts
uses: actions/download-artifact@v4
with:
Expand Down Expand Up @@ -419,23 +428,23 @@ jobs:
# is the undocumented rc-list-profiles command of the
# nexus-staging-maven-plugin:
# mvn org.sonatype.plugins:nexus-staging-maven-plugin:1.6.13:rc-list-profiles -DnexusUrl=https://oss.sonatype.org/ -DserverId=ossrh
- name: Release to OSSRH/Maven Central
- name: Release to Maven Central
if: ${{ !contains( github.event.inputs.release_version, '-M' ) }}
run: |
mkdir deploy
mv nexus-staging deploy
cd deploy
mvn org.sonatype.plugins:nexus-staging-maven-plugin:1.6.13:deploy-staged-repository \
-DnexusUrl=https://oss.sonatype.org/ \
-DserverId=ossrh \
-DrepositoryDirectory=nexus-staging \
-DstagingProfileId=7e73217781f2e
mvn -B -pl '!org.eclipse.esmf:samm-cli' clean deploy -Psign
# run: |
# mkdir deploy
# mv nexus-staging deploy
# cd deploy
# mvn org.sonatype.plugins:nexus-staging-maven-plugin:1.6.13:deploy-staged-repository \
# -DnexusUrl=https://oss.sonatype.org/ \
# -DserverId=ossrh \
# -DrepositoryDirectory=nexus-staging \
# -DstagingProfileId=7e73217781f2e
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
# Workaround for https://issues.sonatype.org/browse/OSSRH-66257
# as described in https://stackoverflow.com/a/70157413
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
CENTRAL_USERNAME: ${{ secrets.CENTRAL_SONATYPE_TOKEN_USERNAME }}
CENTRAL_TOKEN: ${{ secrets.CENTRAL_SONATYPE_TOKEN_PASSWORD }}
PGP_KEY_PASSWORD: ${{ secrets.GPG_PRIVATE_KEY }}

# Milestone release: Write settings to deploy to Github repo
- name: Write settings.xml
Expand Down
17 changes: 12 additions & 5 deletions documentation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,19 @@
</executions>
</plugin>

<!-- <plugin>-->
<!-- <groupId>org.sonatype.plugins</groupId>-->
<!-- <artifactId>nexus-staging-maven-plugin</artifactId>-->
<!-- <configuration>-->
<!-- <skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>-->
<!-- </configuration>-->
<!-- </plugin>-->

<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<configuration>
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
</configuration>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.7.0</version>
<extensions>true</extensions>
</plugin>

<plugin>
Expand Down
Loading