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 all 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
39 changes: 20 additions & 19 deletions .github/workflows/release-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ jobs:

release_version=${{ github.event.inputs.release_version }}

# Actual build of core SDK
mvn -B -pl '!org.eclipse.esmf:samm-cli' clean deploy -Pnative -Dmaven.wagon.httpconnectionManager.ttlSeconds=60 -DaltDeploymentRepository=local::default::file://nexus-staging -Psign
# Actual build of core SDK
mvn -B -pl '!org.eclipse.esmf:samm-cli' clean install -Pnative -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
# Build samm-cli executable jar and run integration tests
unset JAVA_TOOL_OPTIONS
mvn -B -pl tools/samm-cli clean verify -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
Expand Down Expand Up @@ -137,7 +137,6 @@ jobs:
with:
name: linux-artifacts
path: |
nexus-staging/
samm-cli-${{ github.event.inputs.release_version }}-linux-x86_64.tar.gz
samm-cli-${{ github.event.inputs.release_version }}.jar
samm-cli-${{ github.event.inputs.release_version }}-javadoc.jar
Expand Down Expand Up @@ -301,8 +300,10 @@ 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
gpg-private-key: GPG_PRIVATE_KEY
gpg-passphrase: GPG_PASSPHRASE
overwrite-settings: false

# Required to run the mvn:versions, since enforcer plugin
Expand Down Expand Up @@ -419,23 +420,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,!org.eclipse.esmf:documentation' 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