Spring源码构建1
github下载源码
github仓库地址:
https://github.com/spring-projects/spring-framework
切换分支
将分支从main
切换分支到5.2.x
,如果是直接下载的压缩包就不需要切换
构建出现问题
构建过程中如果出现以下错误,需要修改build.gradle
文件,看描述像是权限的问题,既然默认的仓库地址不行,那就换个地址,使用阿里云的镜像仓库
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
Disable Gradle 'offline mode' and sync project
解决
修改buildscript下的repositories,将http://repo.spring.io/plugins-release/ 改成阿里云的镜像地址https://maven.aliyun.com/repository/spring-plugin ,这样就不会报上面的错误了
repositories { gradlePluginPortal() maven { url "https://maven.aliyun.com/nexus/content/repositories/spring-plugin" } }
然后将下面的镜像仓库地址添加到allprojects
的repositories
下,主要是为了加快依赖的下载速度
maven { url "https://maven.aliyun.com/repository/gradle-plugin" }
maven { url "https://maven.aliyun.com/repository/public" }
然后刷新