Skip to content

Commit 600786f

Browse files
authored
Merge pull request #774 from bci-oss/748-change-deployment-to-maven-central
Change a publish plugin for Maven Central
2 parents 6a47363 + 492b489 commit 600786f

File tree

2 files changed

+32
-24
lines changed

2 files changed

+32
-24
lines changed

.github/workflows/release-workflow.yml

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ jobs:
102102
103103
release_version=${{ github.event.inputs.release_version }}
104104
105-
# Actual build of core SDK
106-
mvn -B -pl '!org.eclipse.esmf:samm-cli' clean deploy -Pnative -Dmaven.wagon.httpconnectionManager.ttlSeconds=60 -DaltDeploymentRepository=local::default::file://nexus-staging -Psign
105+
# Actual build of core SDK
106+
mvn -B -pl '!org.eclipse.esmf:samm-cli' clean install -Pnative -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
107107
# Build samm-cli executable jar and run integration tests
108108
unset JAVA_TOOL_OPTIONS
109109
mvn -B -pl tools/samm-cli clean verify -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
@@ -137,7 +137,6 @@ jobs:
137137
with:
138138
name: linux-artifacts
139139
path: |
140-
nexus-staging/
141140
samm-cli-${{ github.event.inputs.release_version }}-linux-x86_64.tar.gz
142141
samm-cli-${{ github.event.inputs.release_version }}.jar
143142
samm-cli-${{ github.event.inputs.release_version }}-javadoc.jar
@@ -301,8 +300,10 @@ jobs:
301300
distribution: 'temurin'
302301
java-version: '21'
303302
server-id: ossrh
304-
server-username: OSSRH_USERNAME
305-
server-password: OSSRH_TOKEN
303+
server-username: CENTRAL_SONATYPE_TOKEN_USERNAME
304+
server-password: CENTRAL_SONATYPE_TOKEN_PASSWORD
305+
gpg-private-key: GPG_PRIVATE_KEY
306+
gpg-passphrase: GPG_PASSPHRASE
306307
overwrite-settings: false
307308

308309
# Required to run the mvn:versions, since enforcer plugin
@@ -419,23 +420,23 @@ jobs:
419420
# is the undocumented rc-list-profiles command of the
420421
# nexus-staging-maven-plugin:
421422
# 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
423+
- name: Release to Maven Central
423424
if: ${{ !contains( github.event.inputs.release_version, '-M' ) }}
424425
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
426+
mvn -B -pl '!org.eclipse.esmf:samm-cli,!org.eclipse.esmf:documentation' clean deploy -Psign
427+
# run: |
428+
# mkdir deploy
429+
# mv nexus-staging deploy
430+
# cd deploy
431+
# mvn org.sonatype.plugins:nexus-staging-maven-plugin:1.6.13:deploy-staged-repository \
432+
# -DnexusUrl=https://oss.sonatype.org/ \
433+
# -DserverId=ossrh \
434+
# -DrepositoryDirectory=nexus-staging \
435+
# -DstagingProfileId=7e73217781f2e
433436
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
437+
CENTRAL_USERNAME: ${{ secrets.CENTRAL_SONATYPE_TOKEN_USERNAME }}
438+
CENTRAL_TOKEN: ${{ secrets.CENTRAL_SONATYPE_TOKEN_PASSWORD }}
439+
PGP_KEY_PASSWORD: ${{ secrets.GPG_PRIVATE_KEY }}
439440

440441
# Milestone release: Write settings to deploy to Github repo
441442
- 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)