IDEA构建spring-framework-5.0.x源码

源码下载

github仓库地址:
https://github.com/spring-projects/spring-framework
可以从网页上下载压缩包,解压到本地,也可以用IDEA直接导入git项目

导入到IDEA

在这里插入图片描述
复制git地址
在这里插入图片描述
将地址复制到url中,点击clone按钮
!](https://img-blog.csdnimg.cn/782027bbbacb4d938fa3d99080497d99.png)

切换分支

将分支从main切换分支到5.0.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

在这里插入图片描述

修改maven仓库地址

参考阿里云镜像仓库的对照表来修改maven仓库的url,参考地址点这里https://developer.aliyun.com/mvn/guide
在这里插入图片描述
修改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" }
}

在这里插入图片描述
然后将下面的镜像仓库地址添加到allprojectsrepositories下,主要是为了加快依赖的下载速度

maven { url "https://maven.aliyun.com/repository/gradle-plugin" }
maven { url "https://maven.aliyun.com/repository/public" }

在这里插入图片描述
修改之后重新构建一下就可以了
在这里插入图片描述

  • 5
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 5
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值