安装gradle的,一定记得配置环境变量,省略。
gradle下载:https://services.gradle.org/distributions/
我的gradle版本是:5.6
spring源码版本:5.2.0
地址:https://github.com/spring-projects/spring-framework
看下源码下的spring-source\spring-framework-master\import-into-idea.md
Steps
Within your locally cloned spring-framework working directory:
1.先安装spring-oxm ,执行spring-source\spring-framework-master\gradlew.bat,这里很可能报错,例如:下载gradle-5.6-bin.zip失败,请看下面的解决方法
- Precompile
spring-oxm
with./gradlew :spring-oxm:compileTestJava
- Import into IntelliJ (File -> New -> Project from Existing Sources -> Navigate to directory -> Select build.gradle)
- When prompted exclude the
spring-aspects
module (or after the import via File-> Project Structure -> Modules) - Code away
idea配置:
下载gradle-5.6-bin.zip失败的解决方法:
配置gradle代理:打开spring-source\spring-framework-master\gradle.properties文件
加入下面配置代理代码
systemProp.http.proxyHost=proxy.xx.com.cn
systemProp.http.proxyPort=80
systemProp.https.proxyHost=proxy.xx.com.cn
systemProp.https.proxyPort=80
再重新在cmd执行 gradlew :spring-oxm:compileTestJava