Skip to content
Merged
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
10 changes: 10 additions & 0 deletions .github/workflows/maven-central-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ jobs:
servers: '[{"id": "central", "username": "${env.MAVEN_CENTRAL_USERNAME}", "password": "${env.MAVEN_CENTRAL_TOKEN}"}]'
sonatypeSnapshots: true

- name: Declare Central as an origin of server central
# Maven 3.10 only sends the credentials of a server to the origins declared for its id, and the id "central"
# is bound to repo.maven.apache.org by the built-in central repository. Add https://central.sonatype.com to the
# origins of server central, so the publishing token reaches Central but not a repository named "central" at
# any other origin (unlike -Dmaven.repository.credentialScope=id). Maven 3.9 ignores the element (with a warning).
shell: bash
run: |
perl -0pi -e 's#(<server>\s*<id>central</id>)#$1\n <repositoryOrigins>\n <repositoryOrigin>https://central.sonatype.com</repositoryOrigin>\n </repositoryOrigins>#' ~/.m2/settings.xml
grep -q '<repositoryOrigin>https://central.sonatype.com</repositoryOrigin>' ~/.m2/settings.xml

- name: Setup Node.js ${{ inputs.nodeVersion }}
uses: actions/setup-node@v6
with:
Expand Down