Search code examples
gradlebuild.gradlegradle-eclipse

Gradle build failure: Could not resolve all dependencies for configuration ':classpath'


I have this error:

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 version 3.6.3


Solution

  • Given that your getting an HTTP 401: Unauthorized, my gut says this is probably a repository {} declaration that you haven't declared credentials for.

    Something like as described in the Gradle User Guide

    repositories {
        maven {
            credentials {
                username 'user'
                password 'password'
            }
            url "http://repo.mycompany.com/maven2"
        }
    }