Skip to content
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
22 changes: 22 additions & 0 deletions .github/maven-settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Maven settings for publishing to Sonatype Central from CI.

Maven 3.10+ binds server credentials to repository origins. The 'central' server id
defaults to https://repo.maven.apache.org, so the Sonatype origin must be declared
explicitly or the credentials are withheld and uploads fail with HTTP 401.
-->
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd">
<servers>
<server>
<id>central</id>
<username>${env.MAVEN_REPO_USERNAME}</username>
<password>${env.MAVEN_REPO_TOKEN}</password>
<repositoryOrigins>
<repositoryOrigin>https://central.sonatype.com</repositoryOrigin>
</repositoryOrigins>
</server>
</servers>
</settings>
7 changes: 2 additions & 5 deletions .github/workflows/cd-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,15 @@ jobs:
distribution: 'temurin'
java-version: 17
cache: 'maven'
server-id: 'central'
server-username: MAVEN_REPO_USERNAME
server-password: MAVEN_REPO_TOKEN
overwrite-settings: false
gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Build the code with Maven
run: mvn -B -ntp install -Pci

- name: Deploy Artifacts
if: ${{ github.actor != 'dependabot[bot]' }}
run: mvn deploy -P publish
run: mvn -B -s .github/maven-settings.xml deploy -P publish
env:
MAVEN_REPO_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
MAVEN_REPO_TOKEN: ${{ secrets.SONATYPE_TOKEN }}
Expand Down
Loading