Spring源码构建:Received status code 401 from server: Unauthorized

最近在看Spring源码的时候突然发现有些jar拉不下来,报了Received status code 401 from server: Unauthorized的错,401代表没有权限。

在这里插入图片描述

Could not HEAD 'https://repo.spring.io/libs-release/org/jetbrains/kotlin/kotlin-compiler-embeddable/1.2.71/kotlin-compiler-embeddable-1.2.71.pom'. Received status code 401 from server: Unauthorized
Disable Gradle 'offline mode' and sync project

原来Spring从5.X之后访问repo.spring.io仓库需要权限认证了,但是我没有Spring仓库的账户和密码改怎么拉去jar呢?在这里我们可以用阿里云的镜像代替Spring官网的镜像。在项目中的build.gradle文件中的镜像修改一下就好啦。

https://maven.aliyun.com/repository/public

Spring源码构建:Received status code 401 from server: Unauthorized_第1张图片
然后再去刷新Gradle发现项目能正常构建了。

Spring源码构建:Received status code 401 from server: Unauthorized_第2张图片

你可能感兴趣的:(Spring,java,mysql,java,spring)