spring-framework-3.2.16.RELEASE源码编译并导入eclipse

spring-framework-3.2.16.RELEASE源码编译

环境:
window 7 64位、jdk8

1、下载spring-framework-3.2.16源码

各版本源码:https://github.com/spring-projects/spring-framework/tags
3.2.16版:https://codeload.github.com/spring-projects/spring-framework/zip/v3.2.16.RELEASE

2、下载完spring-framework-3.2.16源码后,解压

spring-framework-3.2.16.RELEASE源码编译并导入eclipse

3、打开命令窗口CMD,进入到解压目录,运行gradlew.bat

spring-framework-3.2.16.RELEASE源码编译并导入eclipse

如图所示,报错Could not resolve org.springframework.build.gradle:propdeps-plugin:0.0.7
原因:缺少maven库
解决:修改build.gradle文件,在repositories{}里面增加maven { url “http://repo.springsource.org/plugins-release” },如下:
buildscript {
repositories {
maven { url “https://repo.spring.io/plugins-release” }
maven { url “http://repo.springsource.org/plugins-release” }
}

4、修改完后,重新运行gradlew.bat,等几分钟后,出现BUILD SUCCESSFUL

spring-framework-3.2.16.RELEASE源码编译并导入eclipse

5、运行import-into-eclipse.bat,需要等待很久,看网络,如果长时间卡死的话,可以中断然后重复运行。完成后如图:

spring-framework-3.2.16.RELEASE源码编译并导入eclipse

6、按提示,打开eclipse导入编译好的项目

  • 打开eclipse,选“file”-“import”,选“Existing Projects into Workspace”,如图:
    spring-framework-3.2.16.RELEASE源码编译并导入eclipse
  • 然后选择解压的源码目录,如图:
    spring-framework-3.2.16.RELEASE源码编译并导入eclipse
  • 导入后如图:
    spring-framework-3.2.16.RELEASE源码编译并导入eclipse

7、接着在CMD中按回车继续第3步。然后等待。。。完成后如图:

spring-framework-3.2.16.RELEASE源码编译并导入eclipse

8、按第6步导入主工程。完成后点回车,源码编译完成,如图:

spring-framework-3.2.16.RELEASE源码编译并导入eclipse

9、最终eclipse的工程目录,如图:

spring-framework-3.2.16.RELEASE源码编译并导入eclipse