From f6afe4b466b4866fc62d8d72a04066bb31108aef Mon Sep 17 00:00:00 2001 From: Pil0tXia Date: Fri, 26 Jan 2024 20:15:26 +0800 Subject: [PATCH 1/2] integrate checkstyle --- .asf.yaml | 4 +-- .github/workflows/{build.yaml => docker.yml} | 0 README.md | 2 +- .../eventmesh/dashboard/common/Main.java | 18 ++++++++++++- .../dashboard/core/service/Main.java | 7 ----- .../eventmesh/dashboard/observe/Main.java | 18 ++++++++++++- .../eventmesh/dashboard/service/Main.java | 18 ++++++++++++- pom.xml | 27 +++++++++++++++++++ style/checkStyle.xml | 2 +- 9 files changed, 82 insertions(+), 14 deletions(-) rename .github/workflows/{build.yaml => docker.yml} (100%) delete mode 100644 eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/Main.java diff --git a/.asf.yaml b/.asf.yaml index 9ff78571..898b57a2 100644 --- a/.asf.yaml +++ b/.asf.yaml @@ -45,9 +45,9 @@ github: dismiss_stale_reviews: true required_approving_review_count: 1 notifications: - commits: commits@eventmesh.apache.org + commits: commits@eventmesh.apache.org # Send all issue emails (new, closed, comments) to issues@ - issues: issues@eventmesh.apache.org + issues: issues@eventmesh.apache.org # Send new/closed PR notifications to dev@ pullrequests_status: dev@eventmesh.apache.org # Send individual PR comments/reviews to issues@ diff --git a/.github/workflows/build.yaml b/.github/workflows/docker.yml similarity index 100% rename from .github/workflows/build.yaml rename to .github/workflows/docker.yml diff --git a/README.md b/README.md index 5ddd5f57..bf6fbb59 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ 1. eventmesh-dashboard-console 业务模块的代码,调用service接口 2. eventmesh-dashboard-observe 监控模块的代码 -3. eventmesh-dashboard-core 对eventmesh以及相关组件的代码,提供service实现 +3. eventmesh-dashboard-core 对EventMesh Runtime, Meta以及相关组件的代码,提供service实现 4. eventmesh-dashboard-service 公用API接口,对core的抽象 5. eventmesh-dashboard-common 公共模块的代码 6. eventmesh-dashboard-view 前端代码 diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/Main.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/Main.java index a8b0ff7c..673282d6 100644 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/Main.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/Main.java @@ -1,7 +1,23 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.apache.eventmesh.dashboard.common; public class Main { public static void main(String[] args) { - System.out.println("Hello world!"); } } \ No newline at end of file diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/Main.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/Main.java deleted file mode 100644 index f538cd86..00000000 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/Main.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.apache.eventmesh.dashboard.core.service; - -public class Main { - public static void main(String[] args) { - System.out.println("Hello world!"); - } -} \ No newline at end of file diff --git a/eventmesh-dashboard-observe/src/main/java/org/apache/eventmesh/dashboard/observe/Main.java b/eventmesh-dashboard-observe/src/main/java/org/apache/eventmesh/dashboard/observe/Main.java index 1a8fac32..dc40fa22 100644 --- a/eventmesh-dashboard-observe/src/main/java/org/apache/eventmesh/dashboard/observe/Main.java +++ b/eventmesh-dashboard-observe/src/main/java/org/apache/eventmesh/dashboard/observe/Main.java @@ -1,7 +1,23 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.apache.eventmesh.dashboard.observe; public class Main { public static void main(String[] args) { - System.out.println("Hello world!"); } } \ No newline at end of file diff --git a/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/Main.java b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/Main.java index 0927abf9..926f48c5 100644 --- a/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/Main.java +++ b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/Main.java @@ -1,7 +1,23 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.apache.eventmesh.dashboard.service; public class Main { public static void main(String[] args) { - System.out.println("Hello world!"); } } \ No newline at end of file diff --git a/pom.xml b/pom.xml index ed8fd4fb..e8ac69c5 100644 --- a/pom.xml +++ b/pom.xml @@ -89,6 +89,7 @@ eventmesh-dashboard-service eventmesh-dashboard-common + @@ -105,4 +106,30 @@ + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 3.3.1 + + style/checkStyle.xml + true + true + false + config_loc=style + + + + validate + validate + + check + + + + + + \ No newline at end of file diff --git a/style/checkStyle.xml b/style/checkStyle.xml index cfa19728..897dbfa2 100644 --- a/style/checkStyle.xml +++ b/style/checkStyle.xml @@ -23,7 +23,7 @@ - + From 512c2c5a265d4a6862e14b759405a6e16c2de4af Mon Sep 17 00:00:00 2001 From: Pil0tXia Date: Fri, 26 Jan 2024 20:18:00 +0800 Subject: [PATCH 2/2] fix import order & remove excessive try-catch --- .../console/EventmeshConsoleApplication.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventmeshConsoleApplication.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventmeshConsoleApplication.java index 1e4d6dba..a048f24c 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventmeshConsoleApplication.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventmeshConsoleApplication.java @@ -17,22 +17,19 @@ package org.apache.eventmesh.dashboard.console; -import lombok.extern.slf4j.Slf4j; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.ComponentScan; +import lombok.extern.slf4j.Slf4j; + @Slf4j @SpringBootApplication @ComponentScan({"org.apache.eventmesh.dashboard.service", "org.apache.eventmesh.dashboard.console"}) public class EventmeshConsoleApplication { public static void main(String[] args) { - try { - SpringApplication.run(EventmeshConsoleApplication.class, args); - log.info("{} Successfully booted.", EventmeshConsoleApplication.class.getSimpleName()); - } catch (Exception e) { - log.error(e.getMessage(), e); - } + SpringApplication.run(EventmeshConsoleApplication.class, args); + log.info("{} Successfully booted.", EventmeshConsoleApplication.class.getSimpleName()); } }