spring4.0源码下载
2015-05-29 22:41
501 查看
1、下载工具
下载最新的eclipse,因为最新版本的eclipse,自带git插件。已经有eclipse或者git的跳过此步骤。
这个过程比较慢,等下载完成后,在本地已经有了如下文件夹。
![](file:///C:\Users\Administrator\AppData\Roaming\Tencent\Users\770532064\QQ\WinTemp\RichOle\33IC8{333VQO6(G7JLZMD8O.png)
![](file:///C:\Users\Administrator\AppData\Roaming\Tencent\Users\770532064\QQ\WinTemp\RichOle\33IC8{333VQO6(G7JLZMD8O.png)
![](file:///C:\Users\Administrator\AppData\Roaming\Tencent\Users\770532064\QQ\WinTemp\RichOle\33IC8{333VQO6(G7JLZMD8O.png)
![](file:///C:\Users\Administrator\AppData\Roaming\Tencent\Users\770532064\QQ\WinTemp\RichOle\33IC8{333VQO6(G7JLZMD8O.png)
![](file:///C:\Users\Administrator\AppData\Roaming\Tencent\Users\770532064\QQ\WinTemp\RichOle\33IC8{333VQO6(G7JLZMD8O.png)
![](file:///C:\Users\Administrator\AppData\Roaming\Tencent\Users\770532064\QQ\WinTemp\RichOle\33IC8{333VQO6(G7JLZMD8O.png)
![](file:///C:\Users\Administrator\AppData\Roaming\Tencent\Users\770532064\QQ\WinTemp\RichOle\33IC8{333VQO6(G7JLZMD8O.png)
![](file:///C:\Users\Administrator\AppData\Roaming\Tencent\Users\770532064\QQ\WinTemp\RichOle\33IC8{333VQO6(G7JLZMD8O.png)
![](http://img.blog.csdn.net/20150529222725329)
###NOTE###spring4.0源码构建项目,需要用到JDK1.8.0+,否则会失败,出现莫名奇妙的错误。
在刚才下载的文件中,有一个README.md文件,打开后,简单阅读。找到如下文字
## Building from Source
The Spring Framework uses a [Gradle][]-based build system. In the instructions
below, [`./gradlew`][] is invoked from the root of the source tree and serves as
a cross-platform, self-contained bootstrap mechanism for the build.
### Prerequisites
[Git][] and [OpenJDK 8 early access build 100 or later][JDK8 build]
Be sure that your `JAVA_HOME` environment variable points to the `jdk1.8.0` folder
extracted from the JDK download.
### Check out sources
`git clone git@github.com:spring-projects/spring-framework.git`
### Import sources into your IDE
Run `./import-into-eclipse.sh` or read `import-into-idea.md` as appropriate.
> **Note:** Per the prerequisites above, ensure that you have JDK 8 configured properly in your IDE.
### Install all spring-\* jars into your local Maven cache
`./gradlew install`
### Compile and test; build all jars, distribution zips, and docs
`./gradlew build`
... and discover more commands with `./gradlew tasks`. See also the [Gradle
build and release FAQ][].
![](http://img.blog.csdn.net/20150529224231566)
![](http://img.blog.csdn.net/20150529224240052)
###NOTE### 可能由于网络原因,导致下载jar包的时候,会卡住或者中断。这个时候重新双击 import-into-eclipse.bat ,如果再卡住就关掉再点。直到提示BUILD SUCCESS。然后按几次回车后,完成。
![](http://img.blog.csdn.net/20150530150709905?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvemx4NTEwdHNkZQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
有报错,提示
GroovyDynamicElementReader cannot be resolved to a type
说明少groovy的jar包。
安装一个eclipse的groovy插件
在eclipse的 Help -> Install New Software 中,添加groovy的下载连接:
http://dist.springsource.org/milestone/GRECLIPSE/e4.4/
然后全选后,开始下载,下载完后,重启eclipse,然后clean一下项目就搞定了。
下载最新的eclipse,因为最新版本的eclipse,自带git插件。已经有eclipse或者git的跳过此步骤。
http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/lunasr2
2、下载源码
打开eclipse,选择Windows——Preferences——Show View,找到Git Repositories,选择Clone 一个远程repositories。 在url输入框中输入如下地址,并设置一个本地地址,用于存放下载到得代码。git://github.com/SpringSource/Spring-framework.git
这个过程比较慢,等下载完成后,在本地已经有了如下文件夹。
![](file:///C:\Users\Administrator\AppData\Roaming\Tencent\Users\770532064\QQ\WinTemp\RichOle\33IC8{333VQO6(G7JLZMD8O.png)
![](file:///C:\Users\Administrator\AppData\Roaming\Tencent\Users\770532064\QQ\WinTemp\RichOle\33IC8{333VQO6(G7JLZMD8O.png)
![](file:///C:\Users\Administrator\AppData\Roaming\Tencent\Users\770532064\QQ\WinTemp\RichOle\33IC8{333VQO6(G7JLZMD8O.png)
![](file:///C:\Users\Administrator\AppData\Roaming\Tencent\Users\770532064\QQ\WinTemp\RichOle\33IC8{333VQO6(G7JLZMD8O.png)
![](file:///C:\Users\Administrator\AppData\Roaming\Tencent\Users\770532064\QQ\WinTemp\RichOle\33IC8{333VQO6(G7JLZMD8O.png)
![](file:///C:\Users\Administrator\AppData\Roaming\Tencent\Users\770532064\QQ\WinTemp\RichOle\33IC8{333VQO6(G7JLZMD8O.png)
![](file:///C:\Users\Administrator\AppData\Roaming\Tencent\Users\770532064\QQ\WinTemp\RichOle\33IC8{333VQO6(G7JLZMD8O.png)
![](file:///C:\Users\Administrator\AppData\Roaming\Tencent\Users\770532064\QQ\WinTemp\RichOle\33IC8{333VQO6(G7JLZMD8O.png)
3、说明
spring不但将代码放在了git上,项目构建也改为由Gradle构建。所以,想把下载到得spring源码,转换成eclipse项目,还需要靠Gradle。幸运的是,我们刚才下载的文件中,已经包含了Gradle。###NOTE###spring4.0源码构建项目,需要用到JDK1.8.0+,否则会失败,出现莫名奇妙的错误。
在刚才下载的文件中,有一个README.md文件,打开后,简单阅读。找到如下文字
## Building from Source
The Spring Framework uses a [Gradle][]-based build system. In the instructions
below, [`./gradlew`][] is invoked from the root of the source tree and serves as
a cross-platform, self-contained bootstrap mechanism for the build.
### Prerequisites
[Git][] and [OpenJDK 8 early access build 100 or later][JDK8 build]
Be sure that your `JAVA_HOME` environment variable points to the `jdk1.8.0` folder
extracted from the JDK download.
### Check out sources
`git clone git@github.com:spring-projects/spring-framework.git`
### Import sources into your IDE
Run `./import-into-eclipse.sh` or read `import-into-idea.md` as appropriate.
> **Note:** Per the prerequisites above, ensure that you have JDK 8 configured properly in your IDE.
### Install all spring-\* jars into your local Maven cache
`./gradlew install`
### Compile and test; build all jars, distribution zips, and docs
`./gradlew build`
... and discover more commands with `./gradlew tasks`. See also the [Gradle
build and release FAQ][].
<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">下载jdk1.8,注意下载和自己操作系统匹配的版本</span>
<span style="font-family: Arial, Helvetica, sans-serif;">http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html</span>
下载安装后,记得添加环境变量
4、构建项目
双击 import-into-eclipse.bat ,开始构建项目。###NOTE### 可能由于网络原因,导致下载jar包的时候,会卡住或者中断。这个时候重新双击 import-into-eclipse.bat ,如果再卡住就关掉再点。直到提示BUILD SUCCESS。然后按几次回车后,完成。
5、项目导入eclipse
把spring的项目依次导入eclipse中。如下图有报错,提示
GroovyDynamicElementReader cannot be resolved to a type
说明少groovy的jar包。
安装一个eclipse的groovy插件
在eclipse的 Help -> Install New Software 中,添加groovy的下载连接:
http://dist.springsource.org/milestone/GRECLIPSE/e4.4/
然后全选后,开始下载,下载完后,重启eclipse,然后clean一下项目就搞定了。
相关文章推荐
- 疯狂Java学习笔记(60)----------8张图理解Java
- Java NIO原理图文分析及代码实现
- 疯狂Java学习笔记(57)------------NIO:浅析I/O模型
- 疯狂Java学习笔记(58)-----------NIO概述
- 将github上的工程导入到Myeclipse中
- 疯狂Java学习笔记(56)------------对象序列化
- Spring Template(三) ——ORM 设计与实现
- Java synchronized 关于锁的对象顺序问题
- Java Swing 中插入图片背景
- Eclipse + Android + 真机调试的问题
- LeetCode-java实现-T1-Two Sum
- Java学习日记之类和对象:静态成员与实例成员
- java.io.Console的使用以及重定向标准输出/输入
- JAVA 什么时候使用静态
- Spring使用教程(二)配置bean:静态工厂方法和实例工厂方法
- eclipse自动补全的设置
- Java Comparator和Comparable接口的compare方法
- 谈谈java的代理模式认识 三————CGLIB代理
- Java自动拆箱和自动装箱
- 菜鸟java记录四