[英]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.