《spring源码深度解析》读书笔记之——环境搭建

环境:mac 10.11.6 

1、安装github

2、安装gradle

参考地址:https://gradle.org/install/

使用命令:brew update && brew gradle install 

下载完成修改环境配置文件:.bash_profile 

添加以下,路径修改为自己的gradle路径

GRADLE_HOME=/usr/local/Cellar/gradle/4.0

export GRADLE_HOME

export PATH=/usr/local/Cellar/gradle/4.0/bin:$PATH

退出编辑文件,source ~/.bash_profile 使配置文件生效

执行grade -v 查看是否安装成功。

3、源码下载

git clone git://github.com/SpringSource/Spring-framework.git

修改为可以导入eclipse中的形式。不建议一次性编译所有的代码,因为这样会耗费大量的时间,而且当存在编译错误的时候你就不得不重新编译。

建议只对感兴趣的工程进行eclipse工程转换。比如:我们对spring-beans感兴趣,我们切换到spring-beans目录,执行命令:gradle clean idea eclipse 。

4、错误

发现项目前面有一个感叹号,这说明存在错误。查看build path下的projects , 说明该项目依赖其他项目,使用相同的方法导入其他几个项目。



导入之后发现依然报错,却少两个包:

Description	Resource	Path	Location	Type
Project 'spring-core' is missing required library: '/Users/zhongshibo/Documents/java/spring_code/code/Spring-framework/spring-core/build/libs/spring-cglib-repack-3.2.5.jar'	spring-core		Build path	Build Path Problem

Description	Resource	Path	Location	Type
Project 'spring-core' is missing required library: '/Users/zhongshibo/Documents/java/spring_code/code/Spring-framework/spring-core/build/libs/spring-objenesis-repack-2.6.jar'	spring-core		Build path	Build Path Problem


解决:
下载两个包倒入工程:

下载地址:http://download.csdn.net/download/lz_____/9808482  


参考:《spring源码深度解析》

posted @ 2017-07-08 13:15  六七十三  阅读(51)  评论(0编辑  收藏  举报