File tree Expand file tree Collapse file tree 7 files changed +42
-18
lines changed
src/main/resources/META-INF Expand file tree Collapse file tree 7 files changed +42
-18
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,21 @@ Spring Boot With Dubbo
59
59
* 启动 SpringBootDubboClientApplication
60
60
* 打开浏览器访问 http://localhost:2080
61
61
62
+ ### Spring DevTools注意事项
63
+ 由于Spring DevTools采用不一样的classloader的机制,所以会导致Dubbo Consumer Bean无法赋值到指定的@Component 上,请使用以下规则:
64
+
65
+ 在 src/main/resources/META-INF/spring-devtools.properties 在添加以下代码进行DevTools的classloader屏蔽:
66
+ ``` properties
67
+ restart.exclude.target-classes =/target/classes/
68
+ ```
69
+ 关于hotspot的模式下,相关Java代码调整后理解生效,可以考虑: http://dcevm.github.io/
70
+
71
+ 如果你的应用是纯Dubbo服务,没有涉及到Web页面,不建议你添加spring-devtools,如果添加了后,
72
+ 可以通过以下配置项关闭livereload服务,这样可以保证不必要的live reload服务启动。
73
+ ``` properties
74
+ spring.devtools.livereload.enabled =false
75
+ ```
76
+
62
77
### todo
63
78
64
79
* DubboConsumerBuilder: 快速构建Dubbo Consumer
Original file line number Diff line number Diff line change 47
47
</dependency >
48
48
</dependencies >
49
49
</dependencyManagement >
50
+
51
+ <build >
52
+ <plugins >
53
+ <plugin >
54
+ <artifactId >maven-compiler-plugin</artifactId >
55
+ <version >3.6.0</version >
56
+ <configuration >
57
+ <source >1.8</source >
58
+ <target >1.8</target >
59
+ </configuration >
60
+ </plugin >
61
+ </plugins >
62
+ </build >
50
63
</project >
Original file line number Diff line number Diff line change 29
29
<artifactId >curator-framework</artifactId >
30
30
<version >2.11.1</version >
31
31
</dependency >
32
- <dependency >
33
- <groupId >com.101tec</groupId >
34
- <artifactId >zkclient</artifactId >
35
- <version >0.10</version >
36
- </dependency >
37
32
<dependency >
38
33
<groupId >org.springframework.boot</groupId >
39
34
<artifactId >spring-boot-starter-actuator</artifactId >
46
41
<groupId >org.springframework.boot</groupId >
47
42
<artifactId >spring-boot-starter-thymeleaf</artifactId >
48
43
</dependency >
49
- <!-- < dependency>
44
+ <dependency >
50
45
<groupId >org.springframework.boot</groupId >
51
46
<artifactId >spring-boot-devtools</artifactId >
52
- </dependency>-->
47
+ <optional >true</optional >
48
+ </dependency >
53
49
<dependency >
54
50
<groupId >redis.clients</groupId >
55
51
<artifactId >jedis</artifactId >
Original file line number Diff line number Diff line change
1
+ restart.exclude.target-classes =/target/classes/
2
+
Original file line number Diff line number Diff line change 39
39
<artifactId >spring-boot-starter-dubbo</artifactId >
40
40
<version >1.0.0-SNAPSHOT</version >
41
41
</dependency >
42
+ <dependency >
43
+ <groupId >org.springframework.boot</groupId >
44
+ <artifactId >spring-boot-devtools</artifactId >
45
+ <optional >true</optional >
46
+ </dependency >
42
47
<dependency >
43
48
<groupId >redis.clients</groupId >
44
49
<artifactId >jedis</artifactId >
48
53
<artifactId >curator-framework</artifactId >
49
54
<version >2.11.1</version >
50
55
</dependency >
51
- <dependency >
52
- <groupId >com.101tec</groupId >
53
- <artifactId >zkclient</artifactId >
54
- <version >0.10</version >
55
- <exclusions >
56
- <exclusion >
57
- <groupId >org.slf4j</groupId >
58
- <artifactId >slf4j-log4j12</artifactId >
59
- </exclusion >
60
- </exclusions >
61
- </dependency >
62
56
<dependency >
63
57
<groupId >org.springframework.boot</groupId >
64
58
<artifactId >spring-boot-starter-test</artifactId >
Original file line number Diff line number Diff line change
1
+ restart.exclude.target-classes =/target/classes/
2
+
Original file line number Diff line number Diff line change @@ -5,3 +5,5 @@ spring.dubbo.app = dubbo-uic-provider
5
5
spring.dubbo.registry = zookeeper://127.0.0.1:2181
6
6
spring.dubbo.protocol = dubbo
7
7
spring.dubbo.port = 20880
8
+
9
+ spring.devtools.livereload.enabled =false
You can’t perform that action at this time.
0 commit comments