|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<project xmlns="http://maven.apache.org/POM/4.0.0" |
| 3 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 4 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| 5 | + <parent> |
| 6 | + <artifactId>labx-21</artifactId> |
| 7 | + <groupId>cn.iocoder.springboot.labs</groupId> |
| 8 | + <version>1.0-SNAPSHOT</version> |
| 9 | + </parent> |
| 10 | + <modelVersion>4.0.0</modelVersion> |
| 11 | + |
| 12 | + <artifactId>labx-21-sc-zuul-demo03-config-apollo</artifactId> |
| 13 | + <build> |
| 14 | + <plugins> |
| 15 | + <plugin> |
| 16 | + <groupId>org.apache.maven.plugins</groupId> |
| 17 | + <artifactId>maven-compiler-plugin</artifactId> |
| 18 | + <configuration> |
| 19 | + <source>6</source> |
| 20 | + <target>6</target> |
| 21 | + </configuration> |
| 22 | + </plugin> |
| 23 | + </plugins> |
| 24 | + </build> |
| 25 | + |
| 26 | + <properties> |
| 27 | + <spring.boot.version>2.2.4.RELEASE</spring.boot.version> |
| 28 | + <spring.cloud.version>Hoxton.SR1</spring.cloud.version> |
| 29 | + <spring.cloud.alibaba.version>2.2.0.RELEASE</spring.cloud.alibaba.version> |
| 30 | + </properties> |
| 31 | + |
| 32 | + <!-- |
| 33 | + 引入 Spring Boot、Spring Cloud、Spring Cloud Alibaba 三者 BOM 文件,进行依赖版本的管理,防止不兼容。 |
| 34 | + 在 https://dwz.cn/mcLIfNKt 文章中,Spring Cloud Alibaba 开发团队推荐了三者的依赖关系 |
| 35 | + --> |
| 36 | + <dependencyManagement> |
| 37 | + <dependencies> |
| 38 | + <dependency> |
| 39 | + <groupId>org.springframework.boot</groupId> |
| 40 | + <artifactId>spring-boot-starter-parent</artifactId> |
| 41 | + <version>${spring.boot.version}</version> |
| 42 | + <type>pom</type> |
| 43 | + <scope>import</scope> |
| 44 | + </dependency> |
| 45 | + <dependency> |
| 46 | + <groupId>org.springframework.cloud</groupId> |
| 47 | + <artifactId>spring-cloud-dependencies</artifactId> |
| 48 | + <version>${spring.cloud.version}</version> |
| 49 | + <type>pom</type> |
| 50 | + <scope>import</scope> |
| 51 | + </dependency> |
| 52 | + <dependency> |
| 53 | + <groupId>com.alibaba.cloud</groupId> |
| 54 | + <artifactId>spring-cloud-alibaba-dependencies</artifactId> |
| 55 | + <version>${spring.cloud.alibaba.version}</version> |
| 56 | + <type>pom</type> |
| 57 | + <scope>import</scope> |
| 58 | + </dependency> |
| 59 | + </dependencies> |
| 60 | + </dependencyManagement> |
| 61 | + |
| 62 | + <dependencies> |
| 63 | + <!-- 引入 Spring Cloud Zuul 相关依赖,使用它作为网关,并实现对其的自动配置 --> |
| 64 | + <dependency> |
| 65 | + <groupId>org.springframework.cloud</groupId> |
| 66 | + <artifactId>spring-cloud-starter-netflix-zuul</artifactId> |
| 67 | + </dependency> |
| 68 | + |
| 69 | + <!-- 引入 Spring Cloud Alibaba Nacos Discovery 相关依赖,将 Nacos 作为注册中心,并实现对其的自动配置 --> |
| 70 | + <dependency> |
| 71 | + <groupId>com.alibaba.cloud</groupId> |
| 72 | + <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> |
| 73 | + </dependency> |
| 74 | + |
| 75 | + <!-- 引入 Apollo 客户端,内置对 Apollo 的自动化配置 --> |
| 76 | + <dependency> |
| 77 | + <groupId>com.ctrip.framework.apollo</groupId> |
| 78 | + <artifactId>apollo-client</artifactId> |
| 79 | + <version>1.5.1</version> |
| 80 | + </dependency> |
| 81 | + </dependencies> |
| 82 | + |
| 83 | +</project> |
0 commit comments