在 Eclipse 中导入 Gradle 项目时,对等节点未经过身份验证

新手上路,请多包涵

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

 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.

我正在通过代理连接使用互联网。如果这是问题所在,请在 eclipse 中指定代理设置的位置。在General–>Network connections里,代理设置已经有了

请帮忙。

原文由 MrTambourineMan 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 874
2 个回答

注意:在执行这些步骤之前,请确保服务器值得信赖。

如果您收到类似这样的任何其他错误:

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

然后你需要导入证书:

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

它将提示您导入证书,键入 yes 并按回车键。

然后重新启动您的 eclipse 并尝试构建项目。

原文由 dev2d 发布,翻译遵循 CC BY-SA 4.0 许可协议

答案#2:在两次否定标记后提供正确的修复

对顶级 build.gradle 文件进行此更改。

 // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        //jcenter()
        jcenter {
            url "http://jcenter.bintray.com/"  <=THIS IS THE LINE THAT MAKES THE DIFFERENCE
        }
    }
}

allprojects {
    repositories {
        //jcenter()
        jcenter {
            url "http://jcenter.bintray.com/" <=THIS IS THE LINE THAT MAKES THE DIFFERENCE
        }
    }
}

ANSWER#1(虽然这不被接受,但我想保留这个)

如果您看到“peer not authenticated errors”,这并不一定意味着该应用程序没有有效的证书。它也可能意味着连接正在被防火墙、负载平衡器或 Web 服务器重置。尝试(重新)启动具有 Administator 权限的应用程序。

在 Windows 上:

  • 确保您具有管理员权限。
  • 右键单击应用程序图标 -> 选择“以管理员身份运行”

在 Linux 上:

  • 确保您具有根访问权限。
  • 输入 sudo "app execution script name"

原文由 Devendra Vaja 发布,翻译遵循 CC BY-SA 3.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题