|
14 | 14 | <properties>
|
15 | 15 | <!-- 依赖相关配置 -->
|
16 | 16 | <spring.boot.version>2.2.4.RELEASE</spring.boot.version>
|
| 17 | + <spring.cloud.version>Hoxton.SR1</spring.cloud.version> |
| 18 | + <spring.cloud.alibaba.version>2.2.0.RELEASE</spring.cloud.alibaba.version> |
17 | 19 | <!-- 插件相关配置 -->
|
18 | 20 | <maven.compiler.target>1.8</maven.compiler.target>
|
19 | 21 | <maven.compiler.source>1.8</maven.compiler.source>
|
20 | 22 | </properties>
|
21 | 23 |
|
| 24 | + <!-- |
| 25 | + 引入 Spring Boot、Spring Cloud、Spring Cloud Alibaba 三者 BOM 文件,进行依赖版本的管理,防止不兼容。 |
| 26 | + 在 https://dwz.cn/mcLIfNKt 文章中,Spring Cloud Alibaba 开发团队推荐了三者的依赖关系 |
| 27 | + --> |
22 | 28 | <dependencyManagement>
|
23 | 29 | <dependencies>
|
24 | 30 | <dependency>
|
|
28 | 34 | <type>pom</type>
|
29 | 35 | <scope>import</scope>
|
30 | 36 | </dependency>
|
| 37 | + <dependency> |
| 38 | + <groupId>org.springframework.cloud</groupId> |
| 39 | + <artifactId>spring-cloud-dependencies</artifactId> |
| 40 | + <version>${spring.cloud.version}</version> |
| 41 | + <type>pom</type> |
| 42 | + <scope>import</scope> |
| 43 | + </dependency> |
| 44 | + <dependency> |
| 45 | + <groupId>com.alibaba.cloud</groupId> |
| 46 | + <artifactId>spring-cloud-alibaba-dependencies</artifactId> |
| 47 | + <version>${spring.cloud.alibaba.version}</version> |
| 48 | + <type>pom</type> |
| 49 | + <scope>import</scope> |
| 50 | + </dependency> |
31 | 51 | </dependencies>
|
32 | 52 | </dependencyManagement>
|
33 | 53 |
|
|
39 | 59 | <version>1.0-SNAPSHOT</version>
|
40 | 60 | </dependency>
|
41 | 61 |
|
42 |
| - <!-- 引入 Spring Boot 基础 Starter 依赖 --> |
| 62 | + <!-- 实现对 SpringMVC 的自动化配置 --> |
43 | 63 | <dependency>
|
44 | 64 | <groupId>org.springframework.boot</groupId>
|
45 |
| - <artifactId>spring-boot-starter</artifactId> |
| 65 | + <artifactId>spring-boot-starter-web</artifactId> |
46 | 66 | </dependency>
|
47 | 67 |
|
48 | 68 | <!-- 引入 gRPC Server Starter 依赖,实现对 gRPC 的自动配置 -->
|
|
51 | 71 | <artifactId>grpc-server-spring-boot-starter</artifactId>
|
52 | 72 | <version>2.8.0.RELEASE</version>
|
53 | 73 | </dependency>
|
| 74 | + |
| 75 | + <!-- 引入 Spring Cloud Alibaba Nacos Discovery 相关依赖,将 Nacos 作为注册中心,并实现对其的自动配置 --> |
| 76 | + <dependency> |
| 77 | + <groupId>com.alibaba.cloud</groupId> |
| 78 | + <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> |
| 79 | + </dependency> |
54 | 80 | </dependencies>
|
55 | 81 |
|
56 | 82 | </project>
|
0 commit comments