Java Spring boot cli DependencyResolutionFailedException
我是Spring boot的新手,我想开始学习。我已经安装了SpringBootCLI(SpringCLI v1.5.3.RELEASE),并创建了一个简单的服务器,如下所示Java Spring boot cli DependencyResolutionFailedException,java,spring,spring-boot,Java,Spring,Spring Boot,我是Spring boot的新手,我想开始学习。我已经安装了SpringBootCLI(SpringCLI v1.5.3.RELEASE),并创建了一个简单的服务器,如下所示 @RestController class WebApplication { @RequestMapping("/") String home() { "Hello World!" } } 我还设定: export proxy="proxy-info" export https
@RestController
class WebApplication {
@RequestMapping("/")
String home() {
"Hello World!"
}
}
我还设定:
export proxy="proxy-info"
export https-proxy="proxy-info"
export http-proxy="proxy-info"
还设置JAVA_选项,但仍不工作:
-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\u OPTS=-Dhttp.proxyHost=-Dhttp.proxyPort=
cmd>spring run app.groovy
当我试图在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
cmd>set JAVA\u OPTS=-Dhttp.proxyHost=-Dhttp.proxyPort=
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版本。当我用这个groovy程序运行spring命令时,一切都很好。没有依赖性错误,不需要复杂地修改选项或代理内容。我也在尝试相同的初学者示例。 我发现使用更新的版本就是答案。今天我刚刚下载了spring boot cli 2.3.3版本。当我用这个groovy程序运行spring命令时,一切都很好。不需要依赖错误,不需要复杂地修改选项或代理内容