Skip to content

Commit 982e8cf

Browse files
committed
Pass Sonatype OSSRH credentials directly in Maven commands
1 parent 9b83619 commit 982e8cf

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

.github/workflows/maven-central.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,30 @@ jobs:
8787
-Dmaven.test.failure.ignore=false \
8888
-DnexusUrl=https://s01.oss.sonatype.org/ \
8989
-DserverId=ossrh \
90+
-DaltDeploymentRepository=ossrh::default::https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ \
91+
-DrepositoryId=ossrh \
92+
-Dusername=${{ secrets.OSSRH_USERNAME_TOKEN }} \
93+
-Dpassword=${{ secrets.OSSRH_PASSWORD_TOKEN }} \
9094
-X \
9195
-e \
9296
--debug \
9397
-Dgpg.verbose=true \
9498
-Dgpg.debug=true
9599
96100
echo "Checking deployment status..."
97-
mvn nexus-staging:rc-list
101+
mvn nexus-staging:rc-list \
102+
-DserverId=ossrh \
103+
-Dusername=${{ secrets.OSSRH_USERNAME_TOKEN }} \
104+
-Dpassword=${{ secrets.OSSRH_PASSWORD_TOKEN }}
98105
99106
echo "Closing staging repository..."
100-
mvn nexus-staging:rc-close
107+
mvn nexus-staging:rc-close \
108+
-DserverId=ossrh \
109+
-Dusername=${{ secrets.OSSRH_USERNAME_TOKEN }} \
110+
-Dpassword=${{ secrets.OSSRH_PASSWORD_TOKEN }}
101111
102112
echo "Releasing to Maven Central..."
103-
mvn nexus-staging:rc-release
113+
mvn nexus-staging:rc-release \
114+
-DserverId=ossrh \
115+
-Dusername=${{ secrets.OSSRH_USERNAME_TOKEN }} \
116+
-Dpassword=${{ secrets.OSSRH_PASSWORD_TOKEN }}

0 commit comments

Comments
 (0)