This is an automated email from the ASF dual-hosted git repository.

jimin pushed a commit to branch 2.x
in repository https://gitbox.apache.org/repos/asf/incubator-seata.git


The following commit(s) were added to refs/heads/2.x by this push:
     new 65ee819465 optimize: fix problem of `maven-pmd-plugin` (#6297)
65ee819465 is described below

commit 65ee819465be9ca1335fb787fc469535b8429c8a
Author: WangLiang/王良 <[email protected]>
AuthorDate: Wed Jan 24 16:47:44 2024 +0800

    optimize: fix problem of `maven-pmd-plugin` (#6297)
---
 .github/workflows/build.yml                          |  4 ++--
 build/pom.xml                                        |  1 +
 changes/en-us/2.x.md                                 |  1 +
 changes/zh-cn/2.x.md                                 |  1 +
 pom.xml                                              |  3 ++-
 .../mockserver/processor/MockRegisterProcessor.java  | 20 ++++++++++++++++----
 6 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index b80659a131..db561ebe1a 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -29,11 +29,11 @@ jobs:
       - name: "Print maven version"
         run: ./mvnw -version
       # step 4.1
-      - name: "Test, Check style, Check license with Maven and Java8"
+      - name: "Test, Check style, Check PMD, Check license with Maven and 
Java8"
         if: matrix.java == '8'
         run: |
           ./mvnw -T 4C clean test \
-                 -Dcheckstyle.skip=false -Dlicense.skip=false \
+                 -Dcheckstyle.skip=false -Dpmd.skip=false -Dlicense.skip=false 
\
                  -Dmaven.git-commit-id.skip=true \
                  -e -B 
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
       # step 4.2
diff --git a/build/pom.xml b/build/pom.xml
index 29c628818e..88ee087c0c 100644
--- a/build/pom.xml
+++ b/build/pom.xml
@@ -123,6 +123,7 @@
         <!-- Default values of the Maven plugins -->
         <checkstyle.skip>true</checkstyle.skip>
         <license.skip>true</license.skip>
+        <pmd.skip>true</pmd.skip>
         <maven.test.skip>false</maven.test.skip>
         <maven.git-commit-id.skip>false</maven.git-commit-id.skip>
         <maven.surefire.argLine></maven.surefire.argLine>
diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md
index b73728b9da..13f2df3efb 100644
--- a/changes/en-us/2.x.md
+++ b/changes/en-us/2.x.md
@@ -71,6 +71,7 @@ Add changes here for all PR submitted to the 2.x branch.
 - [[#6275](https://github.com/apache/incubator-seata/pull/6275)] optimize the 
label's format in .asf.yaml
 - [[#6291](https://github.com/apache/incubator-seata/pull/6291)] seata-server 
is developed in idea and console support output logs
 - [[#6283](https://github.com/apache/incubator-seata/pull/6283)] add a 
compatible module to support io.seata APIs
+- [[#6297](https://github.com/apache/incubator-seata/pull/6297)] fix problem 
of `maven-pmd-plugin`
 
 ### security:
 - [[#6069](https://github.com/apache/incubator-seata/pull/6069)] Upgrade Guava 
dependencies to fix security vulnerabilities
diff --git a/changes/zh-cn/2.x.md b/changes/zh-cn/2.x.md
index 01ae23aecf..289c93302d 100644
--- a/changes/zh-cn/2.x.md
+++ b/changes/zh-cn/2.x.md
@@ -69,6 +69,7 @@
 - [[#6275](https://github.com/apache/incubator-seata/pull/6275)] 
优化.asf.yaml文件中的label格式
 - [[#6291](https://github.com/apache/incubator-seata/pull/6291)] 
优化seata-server在idea等开发工具运行时,控制台未输出完整日志的问题
 - [[#6283](https://github.com/apache/incubator-seata/pull/6283)] 增加兼容模块支持 
io.seata APIs
+- [[#6297](https://github.com/apache/incubator-seata/pull/6297)] 修复 
`maven-pmd-plugin` 相关的问题
 
 ### security:
 - [[#6069](https://github.com/apache/incubator-seata/pull/6069)] 
升级Guava依赖版本,修复安全漏洞
diff --git a/pom.xml b/pom.xml
index 6851407e78..560a7ab4d8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -342,7 +342,8 @@
                 </configuration>
                 <executions>
                     <execution>
-                        <phase>verify</phase>
+                        <id>pmd-check</id>
+                        <phase>validate</phase>
                         <goals>
                             <goal>check</goal>
                         </goals>
diff --git 
a/test-mock-server/src/main/java/io/seata/mockserver/processor/MockRegisterProcessor.java
 
b/test-mock-server/src/main/java/io/seata/mockserver/processor/MockRegisterProcessor.java
index 225bbbfd83..10f6a8cc0f 100644
--- 
a/test-mock-server/src/main/java/io/seata/mockserver/processor/MockRegisterProcessor.java
+++ 
b/test-mock-server/src/main/java/io/seata/mockserver/processor/MockRegisterProcessor.java
@@ -35,14 +35,18 @@ import org.slf4j.LoggerFactory;
 public class MockRegisterProcessor implements RemotingProcessor {
 
     protected static final Logger LOGGER = 
LoggerFactory.getLogger(MockRegisterProcessor.class);
-    private RemotingServer remotingServer;
-    private Role role;
+
+
+    private final RemotingServer remotingServer;
+    private final Role role;
+
 
     public MockRegisterProcessor(RemotingServer remotingServer, Role role) {
         this.remotingServer = remotingServer;
         this.role = role;
     }
 
+
     @Override
     public void process(ChannelHandlerContext ctx, RpcMessage rpcMessage) 
throws Exception {
         if (role == Role.TM) {
@@ -69,7 +73,15 @@ public class MockRegisterProcessor implements 
RemotingProcessor {
     }
 
 
-    public static enum Role {
-        TM, RM
+    public enum Role {
+        /**
+         * The TM
+         */
+        TM,
+
+        /**
+         * The RM
+         */
+        RM
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to