401 Unauthorized while resolving gradle dependencies

637 Views Asked by At

Suddenly I have started getting the below error.

> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve org.apache.xerces:xercesImpl:2.9.1.
     Required by:
         project : > io.spring.gradle:docbook-reference-plugin:0.3.1
      > Could not resolve org.apache.xerces:xercesImpl:2.9.1.
         > Could not get resource 'https://repo.spring.io/plugins-release/org/apache/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.pom'.
            > Could not GET 'https://repo.spring.io/plugins-release/org/apache/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.pom'. Received status code 401 from server: Unauthorized
   > Could not resolve org.apache.xerces:resolver:2.9.1.
     Required by:
         project : > io.spring.gradle:docbook-reference-plugin:0.3.1
      > Could not resolve org.apache.xerces:resolver:2.9.1.
         > Could not get resource 'https://repo.spring.io/plugins-release/org/apache/xerces/resolver/2.9.1/resolver-2.9.1.pom'.
            > Could not GET 'https://repo.spring.io/plugins-release/org/apache/xerces/resolver/2.9.1/resolver-2.9.1.pom'. Received status code 401 from server: Unauthorized

It was working fine but from past few days it's happening.

below is the build.gradle file config.

buildscript {

repositories {
    mavenCentral()
    jcenter()
    // add spring repo for the docbook plugin
    maven {url 'https://repo.spring.io/plugins-release/'}

    flatDir {
        dirs. 'libs'
    }
}

dependencies {
    // Use the Spring docbook plugin to generate the help files
    classpath 'io.spring.gradle:docbook-reference-plugin:0.3.1'

    // import asciidoctor plugin
    classpath 'org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.15'
}
}

I have googled it a lot but did not the actual cause for this error. As I checked the maven url(https://repo.spring.io/plugins-release/) for Docbook plugin is still the same as mentioned here

https://mvnrepository.com/artifact/io.spring.gradle/docbook-reference-plugin/0.3.1

Even when I try to open the maven url https://repo.spring.io/plugins-release in browser, it's asking for user/password.

0

There are 0 best solutions below