在 Eclipse 中导入 Gradle 项目时对等体未通过身份验证

当我在 eclipse 中导入 gradle 项目时,它给了我这个错误.

FAILURE:构建失败并出现异常.* 什么地方出了错:配置根项目测试"时出现问题.>无法解析配置 ':classpath' 的所有依赖项.>无法解析 de.richsource.gradle.plugins:gwt-gradle-plugin:0.3.要求::测试:未指定>无法获取'https://github.com/steffenschaefer/gwt-gradle-plugin/raw/maven-repo/de/richsource/gradle/plugins/gwt-gradle-plugin/0.3/gwt-gradle-plugin-0.3.庞'.>对等体未通过身份验证* 尝试:使用 --stacktrace 选项运行以获取堆栈跟踪.使用 --info 或 --debug 选项运行以获得更多日志输出.

我通过代理连接使用互联网.如果这是问题所在,那么在 eclipse 中指定代理设置的位置.在General-->网络连接中,代理设置已经存在

请帮忙.

解决方案

注意:在执行这些步骤之前,请确保服务器是可信任的.

如果您遇到任何其他类似的错误:

 无法获取https://some_server.com/some/path/some.pom".>对等体未通过身份验证

那你需要导入证书:

  • 打开'https://some_server.com/some/path/some.pom' 在您最喜欢的浏览器中
  • 使用 步骤导出证书从网站导出证书
  • 将 cer 复制到 JDK_HOME/jre/lib/security 文件夹中
  • 打开一个shell并进入JDK_HOME/jre/lib/security文件夹
  • 然后使用 cer 将 cer 导入到 java 中
<块引用>

keytool -import -alias <服务器的简称>-文件 <cert_file_name_you_exported.cer>-keystore cacerts -storepass changeit

它会提示你导入证书,输入yes然后回车.

然后重新启动你的 Eclipse 并尝试构建项目.

While I am importing gradle project in eclipse, it is giving me this error.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'test'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not resolve de.richsource.gradle.plugins:gwt-gradle-plugin:0.3.
     Required by:
         :test:unspecified
      > Could not GET 'https://github.com/steffenschaefer/gwt-gradle-plugin/raw/maven-repo/de/richsource/gradle/plugins/gwt-gradle-plugin/0.3/gwt-gradle-plugin-0.3.pom'.
         > peer not authenticated

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

I am using internet via proxy connection. If that is the issue, where to specify the proxy settings inside eclipse. In General-->Network connections, proxy settings are already there

Please help.

解决方案

NOTE: Please ensure the server is trustworthy before you follow these steps.

If you get any other error like this:

 Could not GET 'https://some_server.com/some/path/some.pom'.
     > peer not authenticated

Then you need to import a certificate :

  • open the 'https://some_server.com/some/path/some.pom' in your favorite browser
  • export the cert using the Steps to export cert from a web site
  • copy the cer into JDK_HOME/jre/lib/security folder
  • open a shell and go to JDK_HOME/jre/lib/security folder
  • then import the cer into java using the

keytool -import -alias <the short name of the server> -file <cert_file_name_you_exported.cer> -keystore cacerts -storepass changeit

It will prompt you to import the certificate, type yes and press enter.

Then restart your eclipse and try building the project.

相关文章