我想实现基于Baeldung和this pt-br blog一些世界你好春天Zuul项目。
作为第一个使用这种非春季神器
<groupId>com.baeldung.spring.cloud</groupId>
<artifactId>spring-cloud</artifactId>
作为家长和第二个使用this deprecated artifact在dependencyManagement
,我决定用spring initalizr只增加Zuul我的依赖关系。但是,当我运行它,我得到这个异常:
Caused by: java.lang.ClassNotFoundException: com.netflix.zuul.monitoring.CounterFactory
我使用这个注解,在我的主类:
@SpringBootApplication
@EnableZuulProxy
@EnableDiscoveryClient
既然我已经试图删除文件夹.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之后,我终于成功启动我的申请。