From 1f19ceb80928bec0dc8d2884b7be05380042b535 Mon Sep 17 00:00:00 2001 From: Alan Yeh Date: Sat, 25 Nov 2023 15:42:55 +0800 Subject: [PATCH] =?UTF-8?q?[UPDATE]=20=E6=9B=B4=E6=96=B0=E6=8C=81=E7=BB=AD?= =?UTF-8?q?=E9=9B=86=E6=88=90=EF=BC=8C=E6=94=AF=E6=8C=81=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E5=88=B0=20Maven=20Central=20=E5=92=8C=20GitHub=20Packages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alan Yeh --- .github/workflows/publish.yml | 50 +++- central-parent/pom.xml | 250 ++++++++++++------ .../main/java/central/bean/BeanException.java | 10 +- 3 files changed, 218 insertions(+), 92 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 87f5d07..2e8d105 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,11 +1,12 @@ -name: Publish package to Maven Central Repository +name: Publish packages on: push: branches: - master - '*.x' jobs: - publish: + publish-to-github-packages: + name: Publish to GitHub Packages runs-on: ubuntu-latest steps: - name: Checkout sources @@ -15,11 +16,44 @@ jobs: - name: Set up java uses: actions/setup-java@v3 with: - java-version: '17' - distribution: 'zulu' + java-version: 17 + distribution: zulu + server-id: github + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg-passphrase: GPG_PASSPHRASE + - name: Echo settings.xml + run: cat /home/runner/.m2/settings.xml + - name: Publish packages + run: mvn -P github --batch-mode clean deploy + env: + MAVEN_USERNAME: ${{ secrets.GHPKG_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.GHPKG_TOKEN }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + publish-to-maven-central: + name: Publish to Maven Central + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up java + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: zulu server-id: sonatype - server-username: ${{ secrets.MAVEN_USERNAME }} - server-password: ${{secrets.MAVEN_PASSWORD }} - gpg-private-key: ${{ secrets.GPG_SECRET_KEY }} + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg-passphrase: GPG_PASSPHRASE + - name: Echo settings.xml + run: cat /home/runner/.m2/settings.xml - name: Publish packages - run: mvn --batch-mode clean deploy \ No newline at end of file + run: mvn -P sonatype --batch-mode clean deploy + env: + MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} \ No newline at end of file diff --git a/central-parent/pom.xml b/central-parent/pom.xml index fb803c3..cb5b0e6 100644 --- a/central-parent/pom.xml +++ b/central-parent/pom.xml @@ -378,19 +378,6 @@ versions-maven-plugin - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.13 - true - - sonatype - https://s01.oss.sonatype.org/ - true - - - org.apache.maven.plugins @@ -453,7 +440,6 @@ maven-gpg-plugin 3.1.0 - 0x839CD986 --pinentry-mode loopback @@ -473,73 +459,173 @@ - - - - mirror - Mirror Repository - https://mirror.central-x.com/repository/maven-public/ - - always - - - + + + centralx + + + + centralx + CentralX Repository + https://mirror.central-x.com/repository/maven-public/ + + always + + + + + + + centralx + CentralX Repository + https://mirror.central-x.com/repository/maven-public/ + + always + + + + + + + centralx + CentralX Release Repository + https://mirror.central-x.com/repository/maven-releases/ + + + centralx + CentralX Snapshot Repository + https://mirror.central-x.com/repository/maven-snapshots/ + + + + + sonatype - Sonatype Repository - https://s01.oss.sonatype.org/content/groups/public/ - - always - - - - central - Maven Central Repository - https://repo1.maven.org/maven2/ - - always - - - - - - - - mirror - Mirror Repository - https://mirror.central-x.com/repository/maven-public/ - - always - - - - sonatype - Sonatype Repository - https://s01.oss.sonatype.org/content/groups/public/ - - always - - - - central - Maven Central Repository - https://repo1.maven.org/maven2/ - - always - - - - - - - - sonatype - Sonatype Release Repository - https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ - - - sonatype - Sonatype Snapshot Repository - https://s01.oss.sonatype.org/content/repositories/snapshots - - + + true + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.13 + true + + sonatype + https://s01.oss.sonatype.org/ + true + + + + + + + + sonatype + Sonatype Repository + https://s01.oss.sonatype.org/content/groups/public/ + + always + + + + central + Maven Central Repository + https://repo1.maven.org/maven2/ + + always + + + + + + + sonatype + Sonatype Repository + https://s01.oss.sonatype.org/content/groups/public/ + + always + + + + central + Maven Central Repository + https://repo1.maven.org/maven2/ + + always + + + + + + + sonatype + Sonatype Release Repository + https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ + + + sonatype + Sonatype Snapshot Repository + https://s01.oss.sonatype.org/content/repositories/snapshots + + + + + + github + + + + github + GitHub Repository + https://maven.pkg.github.com/central-x/* + + always + + + + central + Maven Central Repository + https://repo1.maven.org/maven2/ + + always + + + + + + + github + GitHub Repository + https://maven.pkg.github.com/central-x/* + + true + always + + + + central + Maven Central Repository + https://repo1.maven.org/maven2/ + + always + + + + + + + github + GitHub Repository + https://maven.pkg.github.com/central-x/central-framework + + true + + + + + + \ No newline at end of file diff --git a/central-stdlib/src/main/java/central/bean/BeanException.java b/central-stdlib/src/main/java/central/bean/BeanException.java index f1cf04a..ba1120d 100644 --- a/central-stdlib/src/main/java/central/bean/BeanException.java +++ b/central-stdlib/src/main/java/central/bean/BeanException.java @@ -25,7 +25,6 @@ package central.bean; import central.lang.PublicApi; -import lombok.experimental.StandardException; import java.io.Serial; @@ -36,8 +35,15 @@ * @since 2022/08/08 */ @PublicApi -@StandardException public class BeanException extends RuntimeException { @Serial private static final long serialVersionUID = 6604630928904931910L; + + public BeanException(String message) { + super(message); + } + + public BeanException(String message, Throwable cause) { + super(message, cause); + } }