Spring5.0原始碼匯入IDEA(一)
阿新 • • 發佈:2019-01-22
1.下載Spring
spring3.x以後託管到github上,所以下載原始碼直接到github上去下載。
下載如下圖:
2.下載Gradle編譯
由於spring是採用Gradle編譯,所以必須下載Gradle
- 配置環境變數
新增:GRADLE_HOME
新增環境變數:Path:%GRADLE_HOME%\bin - 檢測環境
gradle -v
------------------------------------------------------------
Gradle 4.6
------------------------------------------------------------
Build time: 2018-02-28 13:36:36 UTC
Revision: 8fa6ce7945b640e6168488e4417f9bb96e4ab46c
Groovy: 2.4.12
Ant: Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM: 1.8.0_102 (Oracle Corporation 25.102-b14)
OS: Windows 10 10.0 amd64
3.編譯
- cmd 切到:spring-framework-5.0.4.RELEASE 目錄
執行 gradlew.bat
G:\spring-framework\ideaspring\spring-framework-5.0.4.RELEASE>gradlew.bat
> Task :help
Welcome to Gradle 4.4.1.
To run a build, run gradlew <task> ...
To see a list of available tasks, run gradlew tasks
To see a list of command-line options, run gradlew --help
To see more detail about a task, run gradlew help --task <task>
BUILD SUCCESSFUL in 6s
1 actionable task: 1 executed
- 匯入idea
然後等待編譯,編譯時間有點長要有點耐心。
完成:
4.問題
- Error:(30, 0) No such property: values for class: org.gradle.api.internal.tasks.DefaultTaskDependency
Possible solutions: values
Open File(spring-beans\spring-beans.gradle )
點選:Open File 然後註釋掉
//compileGroovy.dependsOn = compileGroovy.taskDependencies.values - ‘compileJava’