在公司代理后面安装Spring Cloud CLI

时间:2018-09-13 12:41:19

标签: maven spring-boot proxy spring-cloud

我已经在Windows上通过sdkman安装了Spring Boot CLI。现在,我尝试使用以下命令安装Spring Cloud CLI:

spring install org.springframework.cloud:spring-cloud-cli:2.0.0.RELEASE

我在公司代理后面,并出现以下错误:

Installing into: C:\Users\user\.sdkman\candidates\springboot\current\bin\..\lib\ext
startup failed:
General error during conversion: org.eclipse.aether.resolution.DependencyResolutionException: Failed to collect dependencies at org.springframework.cloud:spring-cloud-cli:jar:2.0.0.RELEASE

org.springframework.boot.cli.compiler.grape.DependencyResolutionFailedException: org.eclipse.aether.resolution.DependencyResolutionException: Failed to collect dependencies at org.springframework.cloud:spring-cloud-cli:jar:2.0.0.RELEASE
        at org.springframework.boot.cli.compiler.grape.AetherGrapeEngine.resolve(AetherGrapeEngine.java:311)
        at org.springframework.boot.cli.compiler.grape.AetherGrapeEngine.grab(AetherGrapeEngine.java:119)
        at groovy.grape.Grape.grab(Grape.java:167)
        at groovy.grape.GrabAnnotationTransformation.visit(GrabAnnotationTransformation.java:376)
        at org.codehaus.groovy.transform.ASTTransformationVisitor$3.call(ASTTransformationVisitor.java:346)
        at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:966)
        at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:626)
        at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:602)
        at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:579)
        at org.springframework.boot.cli.compiler.GroovyCompiler.compile(GroovyCompiler.java:207)
        at org.springframework.boot.cli.command.install.GroovyGrabDependencyResolver.resolve(GroovyGrabDependencyResolver.java:56)
        at org.springframework.boot.cli.command.install.Installer.install(Installer.java:93)
        at org.springframework.boot.cli.command.install.InstallCommand$InstallOptionHandler.run(InstallCommand.java:58)
        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)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: org.eclipse.aether.resolution.DependencyResolutionException: Failed to collect dependencies at org.springframework.cloud:spring-cloud-cli:jar:2.0.0.RELEASE
        at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:380)
        at org.springframework.boot.cli.compiler.grape.AetherGrapeEngine.resolve(AetherGrapeEngine.java:306)
        ... 25 more
Caused by: org.eclipse.aether.collection.DependencyCollectionException: Failed to collect dependencies at org.springframework.cloud:spring-cloud-cli:jar:2.0.0.RELEASE
        at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:291)
        at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:341)
        ... 26 more
Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.springframework.cloud:spring-cloud-cli:jar:2.0.0.RELEASE
        at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:335)
        at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:217)
        at org.eclipse.aether.internal.impl.DefaultDependencyCollector.resolveCachedArtifactDescriptor(DefaultDependencyCollector.java:535)
        at org.eclipse.aether.internal.impl.DefaultDependencyCollector.getArtifactDescriptorResult(DefaultDependencyCollector.java:519)
        at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:409)
        at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:363)
        at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(DefaultDependencyCollector.java:351)
        at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:254)
        ... 27 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.springframework.cloud:spring-cloud-cli:pom:2.0.0.RELEASE from/to central (https://repo.maven.apache.org/maven2/): repo.maven.apache.org
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:444)
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:223)
        at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:320)
        ... 34 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact org.springframework.cloud:spring-cloud-cli:pom:2.0.0.RELEASE from/to central (https://repo.maven.apache.org/maven2/): repo.maven.apache.org
        at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:43)
        at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:355)
        at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:67)
        at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:581)
        at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:249)
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:520)
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:421)
        ... 37 more
Caused by: java.net.UnknownHostException: repo.maven.apache.org
        at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
        at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
        at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
        at java.net.InetAddress.getAllByName0(InetAddress.java:1276)
        at java.net.InetAddress.getAllByName(InetAddress.java:1192)
        at java.net.InetAddress.getAllByName(InetAddress.java:1126)
        at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45)
        at org.apache.http.impl.conn.DefaultClientConnectionOperator.resolveHostname(DefaultClientConnectionOperator.java:263)
        at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:162)
        at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:326)
        at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:610)
        at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:445)
        at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835)
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
        at org.apache.http.impl.client.DecompressingHttpClient.execute(DecompressingHttpClient.java:164)
        at org.eclipse.aether.transport.http.HttpTransporter.execute(HttpTransporter.java:287)
        at org.eclipse.aether.transport.http.HttpTransporter.implGet(HttpTransporter.java:243)
        at org.eclipse.aether.spi.connector.transport.AbstractTransporter.get(AbstractTransporter.java:59)
        at org.eclipse.aether.connector.basic.BasicRepositoryConnector$GetTaskRunner.runTask(BasicRepositoryConnector.java:447)
        at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:350)
        ... 42 more

1 error

到目前为止,我已经尝试过:

  • 设置环境变量的变体:$JAVA_OPTSJAVA_TOOL_OPTIONSJAVA_OPTIONS。 全部具有价值: -Dhttp.proxyHost=localhost -Dhttp.proxyPort=8888 -Dhttps.proxyHost=localhost -Dhttps.proxyPort=8888 -Dhttps.proxySet=true -Dhttp.proxySet=true

    我在localhost:8888的代理对于其他应用程序运行正常。

  • settings.xml上添加了Maven ~/.m2,因为我在Spring Boot CLI文档中阅读了此内容。

我的settings.xml如下:

<proxies>
 <proxy>
  <id>http</id>
  <active>true</active>
  <protocol>http</protocol>
  <username>proxyuser</username>
  <password>proxypass</password>
  <host>localhost</host>
  <port>8888</port>
  <nonProxyHosts></nonProxyHosts>
 </proxy>
 <proxy>
  <id>https</id>
  <active>true</active>
  <protocol>https</protocol>
  <username>proxyuser</username>
  <password>proxypass</password>
  <host>localhost</host>
  <port>8888</port>
  <nonProxyHosts></nonProxyHosts>
 </proxy>
</proxies>

但是没有效果。

0 个答案:

没有答案