[英]Spring boot cli DependencyResolutionFailedException
我是 Spring Boot 的新手,我想开始学习。 我已经安装了 Spring boot cli (Spring CLI v1.5.3.RELEASE),并且创建了一个简单的服务器,如下所示。
@RestController
class WebApplication {
@RequestMapping("/")
String home() {
"Hello World!"
}
}
我还设置了:
export proxy="proxy-info"
export https-proxy="proxy-info"
export http-proxy="proxy-info"
也设置了JAVA_OPTS,还是不行:
-Dhttp.proxyHost=proxyhostURL
-Dhttp.proxyPort=proxyPortNumber
-Dhttp.proxyUser=someUserName
-Dhttp.proxyPassword=somePassword
启动服务器:
spring run hello.groovy
我得到了例外:
> Resolving dependencies.. startup failed: General error during
> conversion:
> org.eclipse.aether.resolution.DependencyResolutionException: Failed to
> collect dependencies at
> org.springframework.boot:spring-boot-starter:jar:1.5.3.RELEASE
>
> org.springframework.boot.cli.compiler.grape.DependencyResolutionFailedException:
> org.eclipse.aether.resolution.DependencyResolutionException: Failed to
> collect dependencies at
> org.springframework.boot:spring-boot-starter:jar:1.5.3.RELEASE
> at org.springframework.boot.cli.compiler.grape.AetherGrapeEngine.resolve(AetherGrapeEngine.java:324)
> at org.springframework.boot.cli.compiler.grape.AetherGrapeEngine.grab(AetherGrapeEngine.java:129)
> at groovy.grape.Grape.grab(Grape.java:167)
> at groovy.grape.GrabAnnotationTransformation.visit(GrabAnnotationTransformation.java:378)
> at org.codehaus.groovy.transform.ASTTransformationVisitor$3.call(ASTTransformationVisitor.java:321)
> at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:943)
> at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:605)
> at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
> at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)
> at org.springframework.boot.cli.compiler.GroovyCompiler.compile(GroovyCompiler.java:206)
> at org.springframework.boot.cli.command.run.SpringApplicationRunner.compile(SpringApplicationRunner.java:129)
> at org.springframework.boot.cli.command.run.SpringApplicationRunner.compileAndRun(SpringApplicationRunner.java:101)
> at org.springframework.boot.cli.command.run.RunCommand$RunOptionHandler.run(RunCommand.java:111)
> at org.springframework.boot.cli.command.options.OptionHandler.run(OptionHandler.java:84)
> at org.springframework.boot.cli.command.OptionParsingCommand.run(OptionParsingCommand.java:54)
> at org.springframework.boot.cli.command.CommandRunner.run(CommandRunner.java:219)
> at org.springframework.boot.cli.command.CommandRunner.runAndHandleErrors(CommandRunner.java:171)
> at org.springframework.boot.cli.SpringCli.main(SpringCli.java:63)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
....
> 1 error
当我尝试在 Spring boot CLI V1.5.4 中运行示例 Hello World 程序时,我遇到了同样的问题。 这就是我所做的,之后它就开始工作了。
cmd>set JAVA_OPTS=-Dhttp.proxyHost=<proxyhost.domain.com> -Dhttp.proxyPort=<port>
cmd>spring run app.groovy
有效。
cmd>set java_tool_options=-DproxySet=true -DproxyHost=proxy.host -DproxyPort=port
cmd>spring run app.groovy
是为我工作。
我也在尝试相同的入门示例。 我发现使用较新版本是答案。 今天我刚刚下载了 spring-boot-cli 2.3.3 Release。 当我用这个 groovy 程序运行 spring 命令时,一切正常。 没有依赖错误,不需要复杂的选项或代理的东西。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.