在eclipse中导入Gradle项目时未对Peer进行身份验证

MrT*_*Man 49 java gradle gradle-eclipse build.gradle android-gradle-plugin

当我在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.
Run Code Online (Sandbox Code Playgroud)

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

请帮忙.

dev*_*v2d 66

如果你得到这样的任何其他错误:

 Could not GET 'https://some_server.com/some/path/some.pom'.
     > peer not authenticated
Run Code Online (Sandbox Code Playgroud)

然后你需要导入证书:

keytool -import -alias <the short name of the server> -file <cert_file_name_you_exported.cer> -keystore cacerts -storepass changeit
Run Code Online (Sandbox Code Playgroud)

它将提示您导入证书,键入yes并按Enter键.

然后重启你的eclipse并尝试构建项目.

  • 在OSX上.不得不"sudo keytool ...". (3认同)

Dev*_*aja 19

答案#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
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

答案#1(虽然不接受这个想保留这个)

如果您看到"peer not authenticated errors,则并不一定意味着应用程序没有持有有效证书.它也可能意味着防火墙,负载均衡器或Web服务器正在重置连接.尝试(重新)启动具有Administator特权的应用程序.

在Windows上:

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

在Linux上:

  • 确保您具有root访问权限.
  • 类型 sudo "app execution script name"


Shi*_* SS 13

在build.gradle中将存储库更改为以下内容

repositories {
    maven  {
        url "http://repo1.maven.org/maven2"
    }
}
Run Code Online (Sandbox Code Playgroud)


xYa*_*Yan 6

按照上面的答案中的建议导入证书后,编辑gradle.properties文件并插入以下行(请记住您的代理设置):

HTTPS:

systemProp.https.proxyHost=www.somehost.org
systemProp.https.proxyPort=8080
Run Code Online (Sandbox Code Playgroud)

HTTP:

systemProp.http.proxyHost=www.somehost.org
systemProp.http.proxyPort=8080
Run Code Online (Sandbox Code Playgroud)


小智 5

从 java7 升级到 java8 对我来说很有效。