Spring-framework源码编译

1、前置条件
prerequisites

Git and OpenJDK 8 early access build 100 or later

Be sure that your JAVA_HOME environment variable points to the jdk1.8.0 folder extracted from the JDK download.

2、下载源码
check out sources

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

3、导入源码进入Eclipse Kepler

import sources into your IDE

Run ./import-into-eclipse.sh or read import-into-idea.md as appropriate.

-----------------------------------------------------------------------
Spring Framework Eclipse/STS project import guide

This script will guide you through the process of importing the
Spring Framework sources into Eclipse/STS. It is recommended that you
have a recent version of the SpringSource Tool Suite (this script has
been tested against STS '2.9.2.RELEASE'), but at the minimum you will
need Eclipse + AJDT.

If you need to download and install STS, please do that now by
visiting http://spring.io/tools/sts/all

Otherwise, press enter and we'll begin.
请按任意键继续. . .


-----------------------------------------------------------------------
STEP 1: Generate subproject Eclipse metadata

The first step will be to generate Eclipse project metadata for each
of the spring-* subprojects. This happens via the built-in
"Gradle wrapper" script (./gradlew in this directory). If this is your
first time using the Gradle wrapper, this step may take a few minutes
while a Gradle distribution is downloaded for you.

The command run will be:

    gradlew cleanEclipse :spring-oxm:compileTestJava eclipse -x :eclipse

Press enter when ready.
请按任意键继续. . .

这之间,要中断很多次,请保持耐心重复执行上述步骤,直至下面的成功出现:

BUILD SUCCESSFUL

Total time: 2 mins 37.013 secs

-----------------------------------------------------------------------
STEP 2: Import subprojects into Eclipse/STS

Within Eclipse/STS, do the following:

File > Import... > Existing Projects into Workspace
     > When prompted for the 'root directory', provide D:\Java\githubcode\spring
-framework\
     > Press enter. You will see the modules show up under "Projects"
     > All projects should be selected/checked. Click Finish.
     > When the project import is complete, you should have no errors.

When the above is complete, return here and press the enter key.
请按任意键继续. . .

-----------------------------------------------------------------------
STEP 3: generate root project Eclipse metadata

Unfortunately, Eclipse does not allow for importing project
hierarchies, so we had to skip root project metadata generation in the
during step 1. In this step we simply generate root project metadata
so you can import it in the next step.

The command run will be:

    gradlew :eclipse

Press the enter key when ready.
请按任意键继续. . .
:buildSrc:compileJava UP-TO-DATE
:buildSrc:compileGroovy UP-TO-DATE
:buildSrc:processResources UP-TO-DATE
:buildSrc:classes UP-TO-DATE
:buildSrc:jar UP-TO-DATE
:buildSrc:assemble UP-TO-DATE
:buildSrc:compileTestJava UP-TO-DATE
:buildSrc:compileTestGroovy UP-TO-DATE
:buildSrc:processTestResources UP-TO-DATE
:buildSrc:testClasses UP-TO-DATE
:buildSrc:test UP-TO-DATE
:buildSrc:check UP-TO-DATE
:buildSrc:build UP-TO-DATE
:eclipseClasspath
:eclipseJdtPrepare
:eclipseJdt
:eclipseProject
:eclipseSettings
:eclipseWstComponent
:eclipse

BUILD SUCCESSFUL

Total time: 10.384 secs

-----------------------------------------------------------------------
STEP 4: Import root project into Eclipse/STS

Follow the project import steps listed in step 2 above to import the
root project.

Press enter when complete, and move on to the final step.
请按任意键继续. . .


-----------------------------------------------------------------------
STEP 5: Enable Git support for all projects

- In the Eclipse/STS Package Explorer, select all spring* projects.
- Right-click to open the context menu and select Team > Share Project...
- In the Share Project dialog that appears, select Git and press Next
- Check "Use or create repository in parent folder of project"
- Click Finish

When complete, you'll have Git support enabled for all projects.

You're ready to code! Goodbye!

猜你喜欢

转载自lgsd123456.iteye.com/blog/1976087