From c5ff9212a795bc933dd46557a87a2c3971ccdc97 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Thu, 19 Jun 2025 21:04:02 +0530 Subject: [PATCH 1/5] test centrol sonatype release --- .github/workflows/ci.yml | 1 - pom.xml | 23 ++++++----------------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 23d629f3..b7cf304d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,6 @@ jobs: verbose: true publish: - if: startsWith(github.ref, 'refs/tags/v') needs: test runs-on: ubuntu-latest steps: diff --git a/pom.xml b/pom.xml index 6080f058..2a99c8f7 100644 --- a/pom.xml +++ b/pom.xml @@ -97,17 +97,6 @@ - - - ossrh - https://oss.sonatype.org/content/repositories/releases/ - - - ossrh - https://oss.sonatype.org/service/local/repositories/releases/content/ - - - @@ -119,14 +108,14 @@ - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.9 + org.sonatype.central + central-publishing-maven-plugin + 0.4.0 true - ossrh - https://oss.sonatype.org/ - true + central + true + false From d73586055ca714d46b9de7a00b21fd8a8ba99e0f Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Thu, 19 Jun 2025 22:10:29 +0530 Subject: [PATCH 2/5] update secret keys --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b7cf304d..74da66e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,5 +57,5 @@ jobs: run: | mvn deploy -Dgpg.passphrase=${{ secrets.MAVEN_GPG_PASSPHRASE }} env: - MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} From 5fe29433b108fae8647a4749d5c1ef107a54fbbb Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Thu, 19 Jun 2025 22:24:44 +0530 Subject: [PATCH 3/5] debug settings.xml --- .github/workflows/ci.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 74da66e1..7f68c903 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,6 +49,19 @@ jobs: server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} + + - name: Debug Maven Settings + run: | + echo "Checking if settings.xml exists:" + ls -la ~/.m2/ + echo "Content of settings.xml:" + cat ~/.m2/settings.xml || echo "No settings.xml found" + echo "Environment variables:" + echo "MAVEN_CENTRAL_USERNAME is set: $([[ -n "$MAVEN_CENTRAL_USERNAME" ]] && echo "YES" || echo "NO")" + echo "MAVEN_CENTRAL_TOKEN is set: $([[ -n "$MAVEN_CENTRAL_TOKEN" ]] && echo "YES" || echo "NO")" + env: + MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} - name: Build with Maven run: mvn clean package -B From c3293d5113d0c75768dab6e5f36be590e20ab8cf Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Thu, 19 Jun 2025 22:36:42 +0530 Subject: [PATCH 4/5] added step for create settings.xml --- .github/workflows/ci.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f68c903..77e1ebc3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,6 +50,28 @@ jobs: server-password: MAVEN_PASSWORD gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} + - name: Create Maven settings.xml + run: | + mkdir -p ~/.m2 + cat > ~/.m2/settings.xml << 'EOF' + + + + + central + ${env.MAVEN_CENTRAL_USERNAME} + ${env.MAVEN_CENTRAL_TOKEN} + + + + EOF + env: + MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} + - name: Debug Maven Settings run: | echo "Checking if settings.xml exists:" From e4a514bca2a8454d085de69afbede68f93b51874 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 20 Jun 2025 11:51:00 +0530 Subject: [PATCH 5/5] revert publish condition --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 77e1ebc3..b7e3b4fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,6 +36,7 @@ jobs: verbose: true publish: + if: startsWith(github.ref, 'refs/tags/v') needs: test runs-on: ubuntu-latest steps: