Skip to content

Commit 2a99e8c

Browse files
committed
Deploy: temporary maven.repository.credentialScope=id for Maven 3.10
Maven 3.10.0 on the runner image offers server credentials only to the origins bound to the server id. The id central is bound to repo.maven.apache.org, so the token is withheld from central.sonatype.com and the snapshot deploy fails with HTTP 401. credentialScope=id restores the id-only matching until setup-java releases mvn-server-repository-origins (actions/setup-java#1282, release asked in actions/setup-java#1284). Signed-off-by: Stefan Bischof <[email protected]>
1 parent 1bfc0f2 commit 2a99e8c

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎.github/workflows/reuse_java_deploy.yml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,17 @@ jobs:
3838
- name: deploy
3939
# -DskipTests only stops surefire; bnd-resolver and bnd-testing are bound to
4040
# pre-integration-test/integration-test and still ran on every deploy.
41+
# TEMPORARY -Dmaven.repository.credentialScope=id: Maven 3.10 (runner image)
42+
# offers server credentials only to the origins bound to the id, and the id
43+
# central is bound to repo.maven.apache.org, so the token never reaches
44+
# central.sonatype.com (HTTP 401). Remove it once setup-java ships
45+
# mvn-server-repository-origins (actions/setup-java#1282, release asked in
46+
# actions/setup-java#1284) and set
47+
# mvn-server-repository-origins: central:https://central.sonatype.com
4148
run: >-
4249
mvn -Pdeploy --no-transfer-progress --batch-mode -U deploy
4350
-DskipTests -Dbnd.testing.skip=true -Dbnd.resolve.skip=true
51+
-Dmaven.repository.credentialScope=id
4452
env:
4553
MAVEN_USERNAME: ${{ secrets.CENTRAL_SONATYPE_TOKEN_USERNAME }}
4654
MAVEN_PASSWORD: ${{ secrets.CENTRAL_SONATYPE_TOKEN_PASSWORD }}

0 commit comments

Comments
 (0)