idea引入Spring源码 - git clone (第4版)

下面两个链接是我设置好的spring源码
https://github.com/13407196713/my_spring.git
https://gitee.com/raboy/my_spring.git

操作部分来源
https://www.bilibili.com/video/BV1ui4y137K3
https://blog.csdn.net/yy_diego/article/details/116381958
https://blog.csdn.net/guyexiangyun/article/details/106527732
https://ld246.com/article/1617104943096
https://blog.csdn.net/duanNFF/article/details/122294747
https://blog.csdn.net/snow_hope/article/details/115419520

1 Precompile spring-oxm with ./gradlew :spring-oxm:compileTestJava
2 Import into IntelliJ (File -> New -> Project from Existing Sources -> Navigate to directory -> Select build.gradle)
3 When prompted exclude the spring-aspects module (or after the import via 4 File-> Project Structure -> Modules)
4 Code away
# -------------
1. 在源码根目录下执行命令:./gradlew :spring-oxm:compileTestJava。
2. 按照箭头的顺序,一直定位到源码的 build.gradle 文件打开。
3. 源码里没有 `spring-aspects` module 模块。
4. 使用代码

1 预备操作(加速下载)

idea + jdk + maven + gradle + git 的配置操作,见 https://blog.csdn.net/qq_40893824/article/details/117587740

把spring在github的源码拉到自己的gitee上,这样本地拉取的速度会变快
https://github.com/spring-projects/spring-framework
https://gitee.com/raboy/spring-framework

选择 release 版本,这是稳定版

git 配置见 https://blog.csdn.net/qq_40893824/article/details/117587740

命令:
git clone --branch [tags标签] [git地址]
或
git clone -b [tags标签] [git地址]

例如:
git clone -b 1.4.1 https://github.com/jumpserver/coco.git

git clone -b v5.2.19.RELEASE https://gitee.com/raboy/spring-framework.git
git clone --branch v5.2.19.RELEASE https://gitee.com/raboy/spring-framework.git



https://developer.aliyun.com/mvn/guide

repositories

mavenLocal()
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter'}


# 这个版本指的是 spring 源码的版本,不是 gradle 的,别瞎改。
version=5.2.19.RELEASE 
# 注意名字应该是自己下载的 对应的名字 别无脑复制

org.gradle.jvmargs=-Xmx2048M
## 开启 Gradle 缓存
org.gradle.caching=true
## 开启并行编译
org.gradle.parallel=true
## 启用新的孵化模式
org.gradle.configureondemand=true
## 开启守护进程 通过开启守护进程,下一次构建的时候,将会连接这个守护进程进行构建,而不是重新fork一个gradle构建进程
org.gradle.daemon=true


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

执行第1步
法1:

gradlew :spring-oxm:compileTestJava

法2:

./gradlew :spring-oxm:compileTestJava

法1 法2 的结果图都出现了 Build scan background action failed.
采取下图即可消失

2 通过 idea 打开 build.gradle 文件


停止Sync(同步),先设置一下idea的配置


确保本地gradle版本与其一致
https://services.gradle.org/distributions/


上图 Gradle JVM 不可以是 17
因为会报错 见下图



上图表明 Sync(同步)结束
虽然有爆红,但finished了就啥问题,不碍事

build 成功

下载 AspectJ

https://www.eclipse.org/aspectj/downloads.php

注册 AspectJ

D:\download\programming\IntelliJ_IDEA\tools\aspectj\bin;


D:\download\programming\IntelliJ_IDEA\tools\aspectj\bin

win + r + cmd + ajc

aspectj 安装成功

idea 配置 AspectJ


  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

qq_1403034144

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值