Spring STS 3.6.1和Gradle插件

时间:2014-09-30 23:48:45

标签: java spring gradle spring-tool-suite

我已经通过Spring STS 3.6.1的仪表板中的扩展选项卡下载了Gradle支持插件。

然后尝试导入基于gradle的本地项目。但是当我点击按钮" Build Model"。弹出以下错误消息,并且不能将gradel项目导入我的spring STS。

  

无法找到请求目标的有效证书路径请参阅错误   记录详细信息

错误日志详细信息如下:

  

org.eclipse.core.runtime.CoreException:无法找到有效的   要求目标的证明路径   org.springsource.ide.eclipse.gradle.core.GradleModelProvider $ GroupedModelProvider.ensureModels(GradleModelProvider.java:284)     在   org.springsource.ide.eclipse.gradle.core.GradleProject.getGradleModel(GradleProject.java:633)     在   org.springsource.ide.eclipse.gradle.core.GradleProject.getSkeletalGradleModel(GradleProject.java:654)     在   org.springsource.ide.eclipse.gradle.ui.wizards.GradleImportWizardPageOne $ 11.doit(GradleImportWizardPageOne.java:516)     在   org.springsource.ide.eclipse.gradle.core.util.GradleRunnable.run(GradleRunnable.java:84)     在   org.eclipse.jface.operation.ModalContext $ ModalContextThread.run(ModalContext.java:122)   引起:org.gradle.tooling.GradleConnectionException:无法   从中安装Gradle分发   ' https://services.gradle.org/distributions/gradle-2.0-bin.zip&#39 ;.在   org.gradle.tooling.internal.consumer.DistributionFactory $ ZippedDistribution.getToolingImplementationClasspath(DistributionFactory.java:107)     在   org.gradle.tooling.internal.consumer.loader.CachingToolingImplementationLoader.create(CachingToolingImplementationLoader.java:36)     在   org.gradle.tooling.internal.consumer.loader.SynchronizedToolingImplementationLoader.create(SynchronizedToolingImplementationLoader.java:40)     在   org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.onStartAction(LazyConsumerActionExecutor.java:98)     在   org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.run(LazyConsumerActionExecutor.java:81)     在   org.gradle.tooling.internal.consumer.connection.ProgressLoggingConsumerActionExecutor.run(ProgressLoggingConsumerActionExecutor.java:58)     在   org.gradle.tooling.internal.consumer.connection.LoggingInitializerConsumerActionExecutor.run(LoggingInitializerConsumerActionExecutor.java:44)     在   org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor $ 1 $ 1.run(DefaultAsyncConsumerActionExecutor.java:55)     在   org.gradle.internal.concurrent.DefaultExecutorFactory $ StoppableExecutorImpl $ 1.run(DefaultExecutorFactory.java:64)     at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)     at java.util.concurrent.ThreadPoolExecutor $ Worker.run(Unknown Source)     在java.lang.Thread.run(未知来源)at   org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)     在   org.gradle.tooling.internal.consumer.DefaultModelBuilder.get(DefaultModelBuilder.java:48)     在   org.springsource.ide.eclipse.gradle.core.GradleModelProvider.buildModel(GradleModelProvider.java:385)     在   org.springsource.ide.eclipse.gradle.core.GradleModelProvider $ GroupedModelProvider.ensureModels(GradleModelProvider.java:290)     ... 5更多引起:javax.net.ssl.SSLHandshakeException:   sun.security.validator.ValidatorException:PKIX路径构建失败:   sun.security.provider.certpath.SunCertPathBuilderException:无法   找到所请求目标的有效证书路径   sun.security.ssl.Alerts.getSSLException(未知来源)at   sun.security.ssl.SSLSocketImpl.fatal(未知来源)at   sun.security.ssl.Handshaker.fatalSE(未知来源)at   sun.security.ssl.Handshaker.fatalSE(未知来源)at   sun.security.ssl.ClientHandshaker.serverCertificate(未知来源)     在sun.security.ssl.ClientHandshaker.processMessage(未知来源)     在sun.security.ssl.Handshaker.processLoop(未知来源)at   sun.security.ssl.Handshaker.process_record(未知来源)at   sun.security.ssl.SSLSocketImpl.readRecord(未知来源)at   sun.security.ssl.SSLSocketImpl.performInitialHandshake(未知来源)     在sun.security.ssl.SSLSocketImpl.startHandshake(未知来源)at   sun.security.ssl.SSLSocketImpl.startHandshake(未知来源)at   sun.net.www.protocol.https.HttpsClient.afterConnect(未知来源)     在   sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(未知   来源)at   sun.net.www.protocol.http.HttpURLConnection.getInputStream(未知   来源)at   sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(未知   来源)at   org.gradle.wrapper.Download.downloadInternal(Download.java:56)at   org.gradle.wrapper.Download.download(Download.java:42)at   org.gradle.tooling.internal.consumer.DistributionFactory $ ProgressReportingDownload.download(DistributionFactory.java:127)     在org.gradle.wrapper.Install $ 1.call(Install.java:57)at   org.gradle.wrapper.Install $ 1.call(Install.java:44)at   org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)     在org.gradle.wrapper.Install.createDist(Install.java:44)at   org.gradle.tooling.internal.consumer.DistributionFactory $ ZippedDistribution.getToolingImplementationClasspath(DistributionFactory.java:103)     在   org.gradle.tooling.internal.consumer.loader.CachingToolingImplementationLoader.create(CachingToolingImplementationLoader.java:36)     在   org.gradle.tooling.internal.consumer.loader.SynchronizedToolingImplementationLoader.create(SynchronizedToolingImplementationLoader.java:40)     在   org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.onStartAction(LazyConsumerActionExecutor.java:98)     在   org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.run(LazyConsumerActionExecutor.java:81)     在   org.gradle.tooling.internal.consumer.connection.ProgressLoggingConsumerActionExecutor.run(ProgressLoggingConsumerActionExecutor.java:58)     在   org.gradle.tooling.internal.consumer.connection.LoggingInitializerConsumerActionExecutor.run(LoggingInitializerConsumerActionExecutor.java:44)     在   org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor $ 1 $ 1.run(DefaultAsyncConsumerActionExecutor.java:55)     在   org.gradle.internal.concurrent.DefaultExecutorFactory $ StoppableExecutorImpl $ 1.run(DefaultExecutorFactory.java:64)     at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)     at java.util.concurrent.ThreadPoolExecutor $ Worker.run(Unknown Source)     在java.lang.Thread.run(未知来源)引起:   sun.security.validator.ValidatorException:PKIX路径构建失败:   sun.security.provider.certpath.SunCertPathBuilderException:无法   找到所请求目标的有效证书路径   sun.security.validator.PKIXValidator.doBuild(未知来源)at   sun.security.validator.PKIXValidator.engineValidate(未知来源)     在sun.security.validator.Validator.validate(未知来源)at   sun.security.ssl.X509TrustManagerImpl.validate(未知来源)at   sun.security.ssl.X509TrustManagerImpl.checkTrusted(未知来源)at   sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(未知   来源)... 31更多引起:   sun.security.provider.certpath.SunCertPathBuilderException:无法   找到所请求目标的有效证书路径   sun.security.provider.certpath.SunCertPathBuilder.engineBuild(未知   来自java.security.cert.CertPathBuilder.build(未知来源)     ......还有37个

2 个答案:

答案 0 :(得分:10)

  

我查看了STS日志,发现这是问题所在   " org.gradle.tooling.GradleConnectionException:无法安装   Gradle分布来自   ' https://services.gradle.org/distributions/gradle-2.9-bin.zip'"

因此,很明显STS无法下载gradle分发,可能是由于代理设置。以下方法对我有用 -

在STS中,导航到Windows-> Preferences-> Gradle。 在右侧窗格中,将gradle分配下的文件夹设置为gradle目录的路径。我把它设置为" C:\ software \ gradle-2.6"

如果您在下载gradle分发时遇到网络问题,请使用此方法。

答案 1 :(得分:4)

我注意到这是几个月前发布的事实。我希望这个问题已经解决了。但我想分享我为解决这个问题所做的工作。

正如克里斯所说,它与环境有关。如错误所示,它无法找到gradle分发站点的有效证书路径。

我们公司以某种方式拦截证书链并将根证书作为公司CA.我的公司CA Cert不存在于我的Eclipse使用的JRE的jre / lib / security / cacerts密钥库中。我将我公司的CA证书添加到密钥库中,然后它开始工作。我相信它不仅限于Gradle,它应该使用https创建任何其他下载的问题!