正确的依赖管理与Spring Zuul和Spring初始化器

问题描述 投票:0回答:1

我想实现基于Baeldungthis pt-br blog一些世界你好春天Zuul项目。

作为第一个使用这种非春季神器

<groupId>com.baeldung.spring.cloud</groupId>
<artifactId>spring-cloud</artifactId>

作为家长和第二个使用this deprecated artifactdependencyManagement,我决定用spring initalizr只增加Zuul我的依赖关系。但是,当我运行它,我得到这个异常:

Caused by: java.lang.ClassNotFoundException: com.netflix.zuul.monitoring.CounterFactory

我使用这个注解,在我的主类:

@SpringBootApplication
@EnableZuulProxy
@EnableDiscoveryClient
spring-boot netflix-zuul spring-cloud-netflix
1个回答
0
投票

既然我已经试图删除文件夹.m2,这没有工作,我想我的下载没有成功完成一次。但我的错误改变

Caused by: java.lang.ClassNotFoundException: com.netflix.zuul.ZuulFilter

其次是

Caused by: java.util.zip.ZipException: invalid block type

那把这个错误通常是由无效.m2罐引起的。

删除everything在与它“zuul”,包括.m2(外春季目录)com/netflix/zuul,并使用mvn clean package -U使用Maven 3.5.4之后,我终于成功启动我的申请。

© www.soinside.com 2019 - 2024. All rights reserved.