Zuul IDEA配置

关于注解@EnableZuulProxy的坑

需要以下依赖:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-zuul</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-zuul</artifactId>
<version>2.0.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
</dependency>

其中

1
<version>2.0.1.RELEASE</version>

是重要的一环,因为查看spring官网及spring中央仓库可以发现,spring boot2.1.x及以后对应的cloud版本已经不推荐使用上述jar包,所以需要手动指明版本号

--It's the end.Thanks for your read.--