From b59ebc9c61a68de80c204e28affee25b043d7228 Mon Sep 17 00:00:00 2001 From: Nick Cross Date: Fri, 9 May 2025 16:30:52 +0100 Subject: [PATCH] Enable publishing snapshots using central portal --- .github/workflows/maven.yml | 30 +++++++++++++++++++++++++++++- pom.xml | 23 ++++++++++------------- 2 files changed, 39 insertions(+), 14 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 70d4ec4..265a4f5 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -25,4 +25,32 @@ jobs: distribution: 'temurin' cache: maven - name: Build with Maven - run: mvn -B verify --file pom.xml + run: mvn -B -V verify --file pom.xml + + snapshot: + if: | + github.repository == 'eclipse/packager' && + github.event_name == 'push' && github.ref == 'refs/heads/master' && + !contains(github.event.head_commit.message, '[maven-release-plugin] prepare release') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 11 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 11 + # https://github.com/marketplace/actions/maven-setings-action + - name: Maven Settings + uses: s4u/maven-settings-action@v3.1.0 + with: + sonatypeSnapshots: true + githubServer: false + servers: | + [{ + "id": "central", + "username": "${{ secrets.SONATYPE_USERNAME }}", + "password": "${{ secrets.SONATYPE_PASSWORD }}" + }] + - name: Deploy Snapshot + run: mvn -B -V deploy diff --git a/pom.xml b/pom.xml index 020f957..c459629 100644 --- a/pom.xml +++ b/pom.xml @@ -50,17 +50,6 @@ GitHub - - - ossrh - https://oss.sonatype.org/content/repositories/snapshots - - - ossrh - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - - core deb @@ -107,7 +96,6 @@ - org.bouncycastle bcprov-jdk18on @@ -215,6 +203,7 @@ + org.assertj @@ -351,7 +340,15 @@ - + + org.sonatype.central + central-publishing-maven-plugin + 0.7.0 + true + + central + + com.diffplug.spotless spotless-maven-plugin