From 44c57a82bdb61b2a7aea9071cf46c8144f33a0dc Mon Sep 17 00:00:00 2001 From: He Wang Date: Mon, 12 Dec 2022 16:24:20 +0800 Subject: [PATCH] update maven plugin check & format (#66) --- ...maven_build.yml => maven_build_master.yml} | 4 +-- .github/workflows/maven_build_pr.yml | 22 ++++++++++++ .github/workflows/maven_publish_snapshot.yml | 34 ------------------- README.md | 2 +- README_CN.md | 2 +- .../client/connection/ClientHandlerV01.java | 2 +- .../exception/LogProxyClientException.java | 3 +- pom.xml | 5 ++- 8 files changed, 33 insertions(+), 41 deletions(-) rename .github/workflows/{maven_build.yml => maven_build_master.yml} (88%) create mode 100644 .github/workflows/maven_build_pr.yml delete mode 100644 .github/workflows/maven_publish_snapshot.yml diff --git a/.github/workflows/maven_build.yml b/.github/workflows/maven_build_master.yml similarity index 88% rename from .github/workflows/maven_build.yml rename to .github/workflows/maven_build_master.yml index fa919f1..45e0a93 100644 --- a/.github/workflows/maven_build.yml +++ b/.github/workflows/maven_build_master.yml @@ -1,7 +1,7 @@ -name: Maven Build +name: Maven Build on Master Branch on: - pull_request: + push: branches: - master diff --git a/.github/workflows/maven_build_pr.yml b/.github/workflows/maven_build_pr.yml new file mode 100644 index 0000000..03a8bad --- /dev/null +++ b/.github/workflows/maven_build_pr.yml @@ -0,0 +1,22 @@ +name: Maven Build on Pull Request + +on: + pull_request: + paths-ignore: + - 'docs/**' + - '**.md' + - '.*' + +jobs: + build: + name: Maven Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 8 + uses: actions/setup-java@v2 + with: + java-version: '8' + distribution: 'zulu' + - name: Build with Maven + run: mvn clean install diff --git a/.github/workflows/maven_publish_snapshot.yml b/.github/workflows/maven_publish_snapshot.yml deleted file mode 100644 index 0aece4c..0000000 --- a/.github/workflows/maven_publish_snapshot.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Maven Publish Snapshot - -on: - push: - branches: - - master - paths-ignore: - - '.github/**' - - 'docs/**' - - 'scripts/**' - - '**.md' - - '.*' - -jobs: - publish-snapshot: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Setup Apache Maven Central - uses: actions/setup-java@v2 - with: - java-version: '8' - distribution: 'zulu' - server-id: sonatype-nexus-snapshots - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD - gpg-passphrase: GPG_PASSPHRASE - gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} - - name: Publish to Apache Maven Central - run: mvn clean verify gpg:sign install:install deploy:deploy - env: - MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} - GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} diff --git a/README.md b/README.md index 80e4b09..94793d0 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ OceanBase Log Client English | [简体中文](README_CN.md) -[![Build Status](https://github.com/oceanbase/oblogclient/actions/workflows/maven_publish_snapshot.yml/badge.svg?branch=master)](https://github.com/oceanbase/oblogclient/actions/workflows/maven_publish_snapshot.yml) +[![Build Status](https://github.com/oceanbase/oblogclient/actions/workflows/maven_build_master.yml/badge.svg?branch=master)](https://github.com/oceanbase/oblogclient/actions/workflows/maven_build_master.yml) [![Release](https://img.shields.io/github/release/oceanbase/oblogclient.svg)](https://github.com/oceanbase/oblogclient/releases) [![License](https://img.shields.io/badge/license-Mulan%20PSL%20v2-green.svg)](LICENSE) diff --git a/README_CN.md b/README_CN.md index 6be63d7..d75069c 100644 --- a/README_CN.md +++ b/README_CN.md @@ -3,7 +3,7 @@ OceanBase 日志客户端 [English](README.md) | 简体中文 -[![Build Status](https://github.com/oceanbase/oblogclient/actions/workflows/maven_publish_snapshot.yml/badge.svg?branch=master)](https://github.com/oceanbase/oblogclient/actions/workflows/maven_publish_snapshot.yml) +[![Build Status](https://github.com/oceanbase/oblogclient/actions/workflows/maven_build_master.yml/badge.svg?branch=master)](https://github.com/oceanbase/oblogclient/actions/workflows/maven_build_master.yml) [![Release](https://img.shields.io/github/release/oceanbase/oblogclient.svg)](https://github.com/oceanbase/oblogclient/releases) [![License](https://img.shields.io/badge/license-Mulan%20PSL%20v2-green.svg)](LICENSE) diff --git a/oblogclient-logproxy/src/main/java/com/oceanbase/clogproxy/client/connection/ClientHandlerV01.java b/oblogclient-logproxy/src/main/java/com/oceanbase/clogproxy/client/connection/ClientHandlerV01.java index 90613b4..17f3e01 100644 --- a/oblogclient-logproxy/src/main/java/com/oceanbase/clogproxy/client/connection/ClientHandlerV01.java +++ b/oblogclient-logproxy/src/main/java/com/oceanbase/clogproxy/client/connection/ClientHandlerV01.java @@ -31,7 +31,7 @@ import org.apache.commons.lang3.Conversion; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/* Compatitable for legacy V0 and V1 only, however you should not use */ +/** Compatible for legacy V0 and V1 only, however you should not use */ public class ClientHandlerV01 { private static final Logger logger = LoggerFactory.getLogger(ClientHandlerV01.class); diff --git a/oblogclient-logproxy/src/main/java/com/oceanbase/clogproxy/client/exception/LogProxyClientException.java b/oblogclient-logproxy/src/main/java/com/oceanbase/clogproxy/client/exception/LogProxyClientException.java index 68bead5..ebbcc15 100644 --- a/oblogclient-logproxy/src/main/java/com/oceanbase/clogproxy/client/exception/LogProxyClientException.java +++ b/oblogclient-logproxy/src/main/java/com/oceanbase/clogproxy/client/exception/LogProxyClientException.java @@ -10,6 +10,7 @@ See the Mulan PSL v2 for more details. */ package com.oceanbase.clogproxy.client.exception; + import com.oceanbase.clogproxy.client.enums.ErrorCode; /** @@ -93,7 +94,7 @@ public class LogProxyClientException extends RuntimeException { * @param needStop The flag of whether the client should stop the stream. */ public LogProxyClientException( - ErrorCode code, String message, Throwable throwable, boolean needStop) { + ErrorCode code, String message, Throwable throwable, boolean needStop) { super(message, throwable); this.code = code; this.needStop = needStop; diff --git a/pom.xml b/pom.xml index be2dc46..20100eb 100644 --- a/pom.xml +++ b/pom.xml @@ -188,6 +188,9 @@ See the Mulan PSL v2 for more details. jar + + true + @@ -261,7 +264,7 @@ See the Mulan PSL v2 for more details. spotless-check validate - apply + check -- GitLab