Spring boot 使用Spring Boot CLI启动customer stores ui/app.groovy时无法解析类EnableZuulProxy

Spring boot 使用Spring Boot CLI启动customer stores ui/app.groovy时无法解析类EnableZuulProxy,spring-boot,spring-cloud,netflix-zuul,Spring Boot,Spring Cloud,Netflix Zuul,我对springboot和springcloud还不太熟悉,我正在尝试启动客户商店示例。我让微服务运行,但每次我尝试启动UI时 spring run app.groovy 我得到以下例外情况: startup failed: file:/C:/Workspace/git/customers-stores/customers-stores-ui/app.groovy: 1: unable to resolve class EnableZuulProxy , unable to find

我对springboot和springcloud还不太熟悉,我正在尝试启动客户商店示例。我让微服务运行,但每次我尝试启动UI时

spring run app.groovy
我得到以下例外情况:

startup failed:
file:/C:/Workspace/git/customers-stores/customers-stores-ui/app.groovy: 1: unable to     resolve class EnableZuulProxy ,  unable to find class for annotation
@ line 1, column 1.
@EnableZuulProxy
^

1 error
好的,这似乎是一个缺少的依赖项。但我不知道如何添加这种依赖关系。我试过:

@Grab("org.springframework.cloud:spring-cloud-netflix-core:1.0.0.BUILD-SNAPSHOT")
但这并没有改变任何事情。有什么想法吗?提前感谢。

一些讨论倾向于认为install命令存在Windows平台问题,这正是命令告诉您使用的

这个变通方法在Windows上对我有效

$ gvm use springboot 1.1.5.RELEASE
$ cat grabber.groovy
@Grab('org.springframework.cloud:spring-cloud-cli:1.0.0.M1')
class App {}
$ spring grab grabber.groovy
$ find ./repository -name \*.jar -exec cp {} ~/.gvm/springboot/1.1.5.RELEASE/lib \;
然后应该安装所有依赖项

如果您添加了Zuul的初学者,而不是裸核依赖项,@Grab版本就可以工作

@Grab("org.springframework.cloud:spring-cloud-starter-zuul:1.0.0.BUILD-SNAPSHOT")

b显式地为您使用的所有类添加导入。

嗨,Dave,一开始我没有按照自述文件中的说明进行操作。因为这只是关于SpringCloudCLI的。在启动应用程序之前,我是否必须安装Cloud CLI插件?我试过了,但似乎真的有问题。spring install命令似乎没有安装任何资源。添加@Graborg.springframework.cloud:spring cloud starter zuul:1.0.0.BUILD-SNAPSHOT并没有改变任何东西。我想您还需要为注释类添加导入。最好尝试修复CLI插件。你似乎和github里的人在Windows上遇到了同样的问题。你能使用Ubuntu或MacOS进行测试,直到install命令在Windows上运行吗?它与Ubuntu一起工作。Windows似乎有两个问题。1:install命令install-0.0.2.jar查找并列出所需的jar,但不会将任何内容复制到lib文件夹。2:spring.bat文件没有正确创建类路径->lib folder.Wow中有超过spring引导jar的类时,就找不到主类。好吧,这些可能是无关的bug,这里不是讨论这些的最佳场所。