Skip to content

Commit

Permalink
optimize: fix problem of maven-pmd-plugin (#6297)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangliang181230 authored Jan 24, 2024
1 parent bed9b9e commit 65ee819
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions build/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions changes/en-us/2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions changes/zh-cn/2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -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依赖版本,修复安全漏洞
Expand Down
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,8 @@
</configuration>
<executions>
<execution>
<phase>verify</phase>
<id>pmd-check</id>
<phase>validate</phase>
<goals>
<goal>check</goal>
</goals>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,18 @@
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) {
Expand All @@ -69,7 +73,15 @@ public void process(ChannelHandlerContext ctx, RpcMessage rpcMessage) throws Exc
}


public static enum Role {
TM, RM
public enum Role {
/**
* The TM
*/
TM,

/**
* The RM
*/
RM
}
}

0 comments on commit 65ee819

Please sign in to comment.