最近想读下spring3的源码,决定自己构建下spring3以方便阅读源码
参考了以下资料:
Spring Team Blog:
http://blog.springsource.org/2009/03/03/building-spring-3/
http://zachary-guo.iteye.com/blog/661839
一、首先确定你的机器有以下环境:
1.JDK1.6或以上版本(否则不能编译)
2.ant 1.7或以上版本
3.设置以下两个环境变量以确保编译时不会内存溢出:
JAVA_OPTS=-Xms512m -Xmx1024m -XX:MaxNewSize=512m -XX:MaxPermSize=1024m
ANT_OPTS=-Xms256m -Xmx768m -XX:MaxNewSize=256m -XX:MaxPermSize=512m
二、获取源码
用svn从以下地址获得源码
https://github.com/SpringSource/spring-framework/tags/v3.1.1.RELEASE
三、build
打开 {SRC_HOME}\build-spring-framework\build.xml
找到这一行:
<target name="precommit" depends="clean, clean-integration, test"/>
我build过程中总是单元测试不通过,所以这里我"test"去掉,
改成<target name="precommit" depends="clean, clean-integration"/>
(如果有高手解决了单元测试的问题,欢迎指点)
然后在{SRC_HOME}\build-spring-framework\ 目录下打开命令行执行
ant 命令开始build
第一次编译要下载各种依赖,所以抽烟的最好先去抽根烟,不抽烟的最好先去喝杯咖啡,总之就是时间很长
四、将源码导入Eclipse
1.首先设置下IVY_CACHE这个环境变量(spring3所有工程都依赖它)
Window -> Preferences -> Java -> Build Path -> Classpath Variables
IVY_CACHE={SRC_HOME}\ivy-cache\repository
2. File -> Import -> Existing Projects into workspace,选择项目根目录{SRC_HOME},即可导入spring全部模块,可能有几个工程会无法构建,是由于工程依赖的jar包不存在,我急性子,有问题的jar引用直接删除,最后项目都能构建了,但是还有数个工程测试代码报错,引入相关jar包,问题解决
- 大小: 50.3 KB
- 大小: 23.3 KB
- 大小: 180 KB
分享到:
相关推荐
Build a three-tier enterprise Java applicaiton using the lastes the Spring Framework 2.x has to offer.
Building a Rest API with Spring Building a Rest API with Spring
Building Web Apps with Spring 5 and Angular 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除
Building-REST-Services-with-Spring
Building Web Apps with Spring 5 and Angular 英文azw3 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除
Building RESTful Web Services with Spring 5 – Second Edition: Leverage the power of Spring 5.0, Java SE 9, and Spring Boot 2.0 Find out how to implement the REST architecture to build resilient ...
Building Spring 2 Enterprise Applications(2007.8).pdf
Building a RESTful Web Service with Spring 英文无水印pdf pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权...
Building+a+REST+API+with+Spring
Getting Started with Spring Microservices begins with an overview of the Spring Framework 5.0, its design patterns, and its guidelines that enable you to implement responsive microservices at scale....
Building Web Apps with Spring 5 and Angular 英文无水印pdf pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有...
Pro Spring Boot 2 An Authoritative Guide to Building MicroServices, Web and Enterprise Applications, and Best Practices
Pro Spring Boot 2: An Authoritative Guide to Building Microservices, Web and Enterprise Applications, and Best Practices Quickly and productively develop complex Spring applications and microservices...
Building RESTful Web Services with Spring 5(2nd) 英文epub 第2版 本资源转载自网络,如有侵权,请联系上传者或csdn删除查看此书详细信息请在美国亚马逊官网搜索此书
Spring is the most popular Java-based framework for building enterprise applications. The Spring framework provides a rich ecosystem of projects to address modern application needs, like security, ...
Building a RESTful Web Service with Spring
Kotlin shares the same pragmatic, innovative and opinionated mindset as Spring, so they work well together. Spring when combined with Kotlin helps you to reach a new level of productivity. This ...
building rest services with spring