Gradle构建失败:无法解析配置':classpath'的所有依赖项

时间:2015-12-11 10:28:37

标签: gradle build.gradle gradle-eclipse

我有这个错误:

A problem occurred configuring root project <project-name>
Could not resolve all dependencies for configuration ':classpath'.
Could not resolve org.hibernate.build.gradle:version-injection-plugin:1.0.0.
Could not GET 'http:.../gradle/version-injection-plugin/1.0.0/version-injection-plugin-1.0.0.pom'. Received status code 401 from server: Unauthorized
Could not resolve org.tmatesoft.svnkit:svnkit:1.7.11.
Could not GET 'http:.../svnkit/1.7.11/svnkit-1.7.11.pom'. 
Received status code 401 from server: Unauthorized

Gradle版本3.6.3

1 个答案:

答案 0 :(得分:11)

鉴于您获得了HTTP 401:未经授权,我的直觉说这可能是repository {}声明,您尚未申报凭据。

类似于Gradle User Guide

中描述的内容
repositories {
    maven {
        credentials {
            username 'user'
            password 'password'
        }
        url "http://repo.mycompany.com/maven2"
    }
}