Skip to content

Commit e5383b9

Browse files
authored
Refactor dubbo spring boot structure (apache#14794)
* Refactor dubbo spring boot structure Signed-off-by: “JermaineHua” <crazyhzm@gmail.com> * Remove repeated dependency Signed-off-by: “JermaineHua” <crazyhzm@gmail.com> * Change actuator dependency Signed-off-by: “JermaineHua” <crazyhzm@gmail.com> --------- Signed-off-by: “JermaineHua” <crazyhzm@gmail.com>
1 parent a29b43c commit e5383b9

File tree

146 files changed

+731
-470
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+731
-470
lines changed

.artifacts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,13 @@ dubbo-serialization-fastjson2
9090
dubbo-serialization-hessian2
9191
dubbo-spring-boot
9292
dubbo-spring-boot-actuator
93+
dubbo-spring-boot-actuator-autoconfigure
9394
dubbo-spring-boot-actuator-compatible
9495
dubbo-spring-boot-autoconfigure
9596
dubbo-spring-boot-3-autoconfigure
9697
dubbo-spring-boot-autoconfigure-compatible
98+
dubbo-spring-boot-actuator-autoconfigure-compatible
9799
dubbo-spring-boot-compatible
98-
dubbo-observability-spring-boot-starters
99100
dubbo-tracing-brave-zipkin-spring-boot-starter
100101
dubbo-tracing-otel-zipkin-spring-boot-starter
101102
dubbo-tracing-otel-otlp-spring-boot-starter

dubbo-dependencies-bom/pom.xml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,10 @@
187187
<open_feign_version>3.1.9</open_feign_version>
188188
<jakarta.xml.bind-api.version>4.0.2</jakarta.xml.bind-api.version>
189189
<jaxb-runtime.version>2.4.0-b180830.0438</jaxb-runtime.version>
190+
<spring-boot.version>2.7.18</spring-boot.version>
191+
<!-- Spring boot buddy is lower than the delivery dependency package version and can only show the defined dependency version -->
192+
<byte-buddy.version>1.15.1</byte-buddy.version>
193+
<prometheus-client.version>0.16.0</prometheus-client.version>
190194

191195
<revision>3.3.2-SNAPSHOT</revision>
192196
</properties>
@@ -215,6 +219,7 @@
215219
<type>pom</type>
216220
<scope>import</scope>
217221
</dependency>
222+
218223
<dependency>
219224
<groupId>io.micrometer</groupId>
220225
<artifactId>micrometer-bom</artifactId>
@@ -243,6 +248,50 @@
243248
<type>pom</type>
244249
<scope>import</scope>
245250
</dependency>
251+
<dependency>
252+
<groupId>io.prometheus</groupId>
253+
<artifactId>simpleclient_bom</artifactId>
254+
<version>${prometheus-client.version}</version>
255+
<type>pom</type>
256+
<scope>import</scope>
257+
</dependency>
258+
<!-- Spring Boot -->
259+
<dependency>
260+
<groupId>org.springframework.boot</groupId>
261+
<artifactId>spring-boot-dependencies</artifactId>
262+
<version>${spring-boot.version}</version>
263+
<type>pom</type>
264+
<scope>import</scope>
265+
<exclusions>
266+
<exclusion>
267+
<groupId>io.micrometer</groupId>
268+
<artifactId>micrometer-core</artifactId>
269+
</exclusion>
270+
</exclusions>
271+
</dependency>
272+
<dependency>
273+
<groupId>org.springframework.boot</groupId>
274+
<artifactId>spring-boot-starter-logging</artifactId>
275+
<version>${spring-boot.version}</version>
276+
<exclusions>
277+
<exclusion>
278+
<groupId>ch.qos.logback</groupId>
279+
<artifactId>logback-classic</artifactId>
280+
</exclusion>
281+
<exclusion>
282+
<groupId>org.apache.logging.log4j</groupId>
283+
<artifactId>log4j-to-slf4j</artifactId>
284+
</exclusion>
285+
<exclusion>
286+
<groupId>org.slf4j</groupId>
287+
<artifactId>log4j-over-slf4j</artifactId>
288+
</exclusion>
289+
<exclusion>
290+
<groupId>org.slf4j</groupId>
291+
<artifactId>log4j-to-slf4j</artifactId>
292+
</exclusion>
293+
</exclusions>
294+
</dependency>
246295
<dependency>
247296
<groupId>io.netty</groupId>
248297
<artifactId>netty-all</artifactId>
@@ -689,6 +738,12 @@
689738
<version>${junit_platform_version}</version>
690739
<scope>test</scope>
691740
</dependency>
741+
<dependency>
742+
<groupId>org.junit.platform</groupId>
743+
<artifactId>junit-platform-commons</artifactId>
744+
<version>${junit_platform_version}</version>
745+
<scope>test</scope>
746+
</dependency>
692747
<dependency>
693748
<groupId>org.junit.platform</groupId>
694749
<artifactId>junit-platform-launcher</artifactId>

dubbo-distribution/dubbo-bom/pom.xml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,11 @@
475475
<artifactId>dubbo-spring-boot-actuator</artifactId>
476476
<version>${project.version}</version>
477477
</dependency>
478+
<dependency>
479+
<groupId>org.apache.dubbo</groupId>
480+
<artifactId>dubbo-spring-boot-actuator-autoconfigure</artifactId>
481+
<version>${project.version}</version>
482+
</dependency>
478483
<dependency>
479484
<groupId>org.apache.dubbo</groupId>
480485
<artifactId>dubbo-spring-boot-autoconfigure</artifactId>
@@ -493,7 +498,7 @@
493498
</dependency>
494499
<dependency>
495500
<groupId>org.apache.dubbo</groupId>
496-
<artifactId>dubbo-spring-boot-actuator-compatible</artifactId>
501+
<artifactId>dubbo-spring-boot-actuator-autoconfigure</artifactId>
497502
<version>${project.version}</version>
498503
</dependency>
499504
<dependency>
@@ -503,23 +508,22 @@
503508
</dependency>
504509
<dependency>
505510
<groupId>org.apache.dubbo</groupId>
506-
<artifactId>dubbo-spring-boot-starter</artifactId>
511+
<artifactId>dubbo-spring-boot-actuator-autoconfigure-compatible</artifactId>
507512
<version>${project.version}</version>
508513
</dependency>
509514
<dependency>
510515
<groupId>org.apache.dubbo</groupId>
511-
<artifactId>dubbo-spring-boot-interceptor</artifactId>
516+
<artifactId>dubbo-spring-boot-starter</artifactId>
512517
<version>${project.version}</version>
513518
</dependency>
514519
<dependency>
515520
<groupId>org.apache.dubbo</groupId>
516-
<artifactId>dubbo-spring-boot-starters</artifactId>
521+
<artifactId>dubbo-spring-boot</artifactId>
517522
<version>${project.version}</version>
518-
<type>pom</type>
519523
</dependency>
520524
<dependency>
521525
<groupId>org.apache.dubbo</groupId>
522-
<artifactId>dubbo-observability-spring-boot-starters</artifactId>
526+
<artifactId>dubbo-spring-boot-starters</artifactId>
523527
<version>${project.version}</version>
524528
<type>pom</type>
525529
</dependency>
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one or more
4+
contributor license agreements. See the NOTICE file distributed with
5+
this work for additional information regarding copyright ownership.
6+
The ASF licenses this file to You under the Apache License, Version 2.0
7+
(the "License"); you may not use this file except in compliance with
8+
the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
-->
18+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
19+
<modelVersion>4.0.0</modelVersion>
20+
<parent>
21+
<groupId>org.apache.dubbo</groupId>
22+
<artifactId>dubbo-parent</artifactId>
23+
<version>${revision}</version>
24+
<relativePath>../../pom.xml</relativePath>
25+
</parent>
26+
27+
<artifactId>dubbo-spring-boot-actuator-autoconfigure</artifactId>
28+
<description>Apache Dubbo Spring Boot Actuator Autoconfigure</description>
29+
30+
<dependencies>
31+
32+
<dependency>
33+
<groupId>org.springframework.boot</groupId>
34+
<artifactId>spring-boot-starter-web</artifactId>
35+
<optional>true</optional>
36+
</dependency>
37+
38+
<dependency>
39+
<groupId>org.apache.tomcat.embed</groupId>
40+
<artifactId>tomcat-embed-core</artifactId>
41+
<optional>true</optional>
42+
</dependency>
43+
44+
<dependency>
45+
<groupId>org.apache.dubbo</groupId>
46+
<artifactId>dubbo-spring-boot-actuator</artifactId>
47+
<version>${project.version}</version>
48+
</dependency>
49+
50+
<dependency>
51+
<groupId>org.springframework.boot</groupId>
52+
<artifactId>spring-boot-actuator-autoconfigure</artifactId>
53+
<optional>true</optional>
54+
</dependency>
55+
56+
<!-- Dubbo autoconfigure -->
57+
<dependency>
58+
<groupId>org.apache.dubbo</groupId>
59+
<artifactId>dubbo-spring-boot-autoconfigure</artifactId>
60+
<version>${project.version}</version>
61+
</dependency>
62+
63+
<!-- @ConfigurationProperties annotation processing (metadata for IDEs) -->
64+
<dependency>
65+
<groupId>org.springframework.boot</groupId>
66+
<artifactId>spring-boot-configuration-processor</artifactId>
67+
<optional>true</optional>
68+
</dependency>
69+
70+
<dependency>
71+
<groupId>org.apache.dubbo</groupId>
72+
<artifactId>dubbo-spring-boot-actuator-autoconfigure-compatible</artifactId>
73+
<version>${project.version}</version>
74+
</dependency>
75+
76+
<dependency>
77+
<groupId>org.apache.dubbo</groupId>
78+
<artifactId>dubbo</artifactId>
79+
<version>${project.version}</version>
80+
</dependency>
81+
82+
<dependency>
83+
<groupId>org.apache.dubbo</groupId>
84+
<artifactId>dubbo-common</artifactId>
85+
<version>${project.version}</version>
86+
<optional>true</optional>
87+
</dependency>
88+
89+
<dependency>
90+
<groupId>org.apache.dubbo</groupId>
91+
<artifactId>dubbo-config-spring</artifactId>
92+
<version>${project.version}</version>
93+
<optional>true</optional>
94+
</dependency>
95+
96+
<dependency>
97+
<groupId>org.apache.dubbo</groupId>
98+
<artifactId>dubbo-rpc-dubbo</artifactId>
99+
<version>${project.version}</version>
100+
<scope>test</scope>
101+
</dependency>
102+
103+
<dependency>
104+
<groupId>org.apache.dubbo</groupId>
105+
<artifactId>dubbo-qos</artifactId>
106+
<version>${project.version}</version>
107+
<optional>true</optional>
108+
</dependency>
109+
110+
<!-- Test Dependencies -->
111+
<dependency>
112+
<groupId>org.springframework.boot</groupId>
113+
<artifactId>spring-boot-starter-test</artifactId>
114+
<scope>test</scope>
115+
</dependency>
116+
<dependency>
117+
<groupId>org.springframework.boot</groupId>
118+
<artifactId>spring-boot-starter-log4j2</artifactId>
119+
<scope>test</scope>
120+
</dependency>
121+
122+
<!--JUnit Jupiter Engine to depend on the JUnit4 engine and JUnit 4 API -->
123+
<dependency>
124+
<groupId>org.junit.vintage</groupId>
125+
<artifactId>junit-vintage-engine</artifactId>
126+
<scope>test</scope>
127+
</dependency>
128+
<dependency>
129+
<groupId>net.bytebuddy</groupId>
130+
<artifactId>byte-buddy</artifactId>
131+
<scope>test</scope>
132+
</dependency>
133+
<dependency>
134+
<groupId>net.bytebuddy</groupId>
135+
<artifactId>byte-buddy-agent</artifactId>
136+
<scope>test</scope>
137+
</dependency>
138+
<dependency>
139+
<groupId>org.apache.dubbo</groupId>
140+
<artifactId>dubbo-test-check</artifactId>
141+
<version>${project.parent.version}</version>
142+
<scope>test</scope>
143+
</dependency>
144+
<dependency>
145+
<groupId>org.apache.logging.log4j</groupId>
146+
<artifactId>log4j-slf4j-impl</artifactId>
147+
<scope>test</scope>
148+
</dependency>
149+
</dependencies>
150+
</project>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
package org.apache.dubbo.spring.boot.actuate.autoconfigure;
1818

19-
import org.apache.dubbo.spring.boot.actuate.endpoint.configuration.DubboActuatorProperties;
19+
import org.apache.dubbo.spring.boot.actuate.endpoint.DubboActuatorProperties;
2020

2121
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
2222
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
2+
org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboHealthIndicatorAutoConfiguration,\
3+
org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboEndpointMetadataAutoConfiguration,\
24
org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboEndpointAnnotationAutoConfiguration,\
35
org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboMetricsAutoConfiguration
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboEndpointAutoConfiguration
21
org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboHealthIndicatorAutoConfiguration
32
org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboEndpointMetadataAutoConfiguration
43
org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboExtensionEndpointAutoConfiguration
4+
org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboEndpointAnnotationAutoConfiguration
5+
org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboMetricsAutoConfiguration

dubbo-spring-boot/dubbo-spring-boot-actuator/pom.xml renamed to dubbo-spring-boot-project/dubbo-spring-boot-actuator/pom.xml

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
<modelVersion>4.0.0</modelVersion>
2020
<parent>
2121
<groupId>org.apache.dubbo</groupId>
22-
<artifactId>dubbo-spring-boot</artifactId>
22+
<artifactId>dubbo-parent</artifactId>
2323
<version>${revision}</version>
24-
<relativePath>../pom.xml</relativePath>
24+
<relativePath>../../pom.xml</relativePath>
2525
</parent>
2626

2727
<artifactId>dubbo-spring-boot-actuator</artifactId>
@@ -30,12 +30,6 @@
3030

3131
<dependencies>
3232

33-
<dependency>
34-
<groupId>org.apache.dubbo</groupId>
35-
<artifactId>dubbo-spring-boot-actuator-compatible</artifactId>
36-
<version>${project.version}</version>
37-
</dependency>
38-
3933
<!-- Spring Boot -->
4034
<dependency>
4135
<groupId>org.springframework.boot</groupId>
@@ -49,16 +43,9 @@
4943
<optional>true</optional>
5044
</dependency>
5145

52-
<dependency>
53-
<groupId>org.springframework.boot</groupId>
54-
<artifactId>spring-boot-autoconfigure</artifactId>
55-
<optional>true</optional>
56-
</dependency>
57-
58-
<!-- Dubbo autoconfigure -->
5946
<dependency>
6047
<groupId>org.apache.dubbo</groupId>
61-
<artifactId>dubbo-spring-boot-autoconfigure</artifactId>
48+
<artifactId>dubbo-spring-boot</artifactId>
6249
<version>${project.version}</version>
6350
</dependency>
6451

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
package org.apache.dubbo.spring.boot.actuate.endpoint.configuration;
17+
package org.apache.dubbo.spring.boot.actuate.endpoint;
1818

1919
import java.util.Map;
2020

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import org.apache.dubbo.qos.command.ActuatorExecutor;
2020
import org.apache.dubbo.rpc.model.ApplicationModel;
21-
import org.apache.dubbo.spring.boot.actuate.endpoint.configuration.DubboActuatorProperties;
2221
import org.apache.dubbo.spring.boot.actuate.endpoint.metadata.DubboMetadata;
2322

2423
import java.util.Map;

0 commit comments

Comments
 (0)