From f2b87607d140f55e7f4c877f919b21505f222581 Mon Sep 17 00:00:00 2001 From: Matteo Merli Date: Tue, 30 Jan 2024 16:43:35 -0800 Subject: [PATCH] Fixed publishing to Maven Central --- .../workflows/ci-maven-publish-release.yaml | 2 +- etc/settings.xml | 39 +++++++++++++++++++ pom.xml | 38 ++++++------------ 3 files changed, 52 insertions(+), 27 deletions(-) create mode 100644 etc/settings.xml diff --git a/.github/workflows/ci-maven-publish-release.yaml b/.github/workflows/ci-maven-publish-release.yaml index df530ba2..f43ceb4f 100644 --- a/.github/workflows/ci-maven-publish-release.yaml +++ b/.github/workflows/ci-maven-publish-release.yaml @@ -47,7 +47,7 @@ jobs: name: test-results path: test-results.zip - name: Publish to the Maven Central Repository - run: mvn --batch-mode -Prelease -DskipTests deploy + run: mvn --batch-mode -s etc/settings.xml -Prelease -DskipTests deploy env: MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }} MAVEN_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} diff --git a/etc/settings.xml b/etc/settings.xml new file mode 100644 index 00000000..5e9d4a56 --- /dev/null +++ b/etc/settings.xml @@ -0,0 +1,39 @@ + + + + + central + ${env.SONATYPE_USERNAME} + ${env.SONATYPE_PASSWORD} + + + + + + sonatype + + true + + + ${env.GPG_PRIVATE_KEY} + ${env.GPG_PRIVATE_KEY_PASSPHRASE} + + + + diff --git a/pom.xml b/pom.xml index a08fa132..f534154e 100644 --- a/pom.xml +++ b/pom.xml @@ -448,32 +448,6 @@ release - - - net.nicoulaj.maven.plugins - checksum-maven-plugin - 1.11 - - - source-release-checksum - - artifacts - - post-integration-test - - - MD5 - SHA-1 - SHA-512 - - source-release - true - false - true - - - - org.apache.maven.plugins @@ -522,6 +496,18 @@ + + org.sonatype.central + central-publishing-maven-plugin + 0.3.0 + true + + central + true + true + published + +