Springソースコンパイル
2688 ワード
http://www.flyoung.me/2013/08/02/springcodecompile/
前言
Springのソースは前に読んだことがあります.主にIOCの部分を読んでいます.パソコンを変えたことに加えて、他の部分も見たいと思い、また来たことがある.SpringソースはGitHubに移転しました.
準備工作
GitとJDK 1.7+が必要です.最新のspring-frame ewarkはgradleでコンパイルしたので、gradleをダウンロードする必要があります.
ダウンロード
私はSpring 3.2.xバージョンをダウンロードしました.
1、gradlew.batのjvmメモリ設定に関するパラメータを修正します.
元の設定:
3、すべてのスプリング-jarsを地元のMaven cacheにインストールし、
4、ソースコードをeclipseに導入する.
4.1、cmdウィンドウ実行コマンド
4.3、cmdウィンドウで
4.4、eclipse File>Import...>Existing Projects into WorkspaceによってsprigFraamework親プロジェクトを導入する.
締め括りをつける
全過程は苦労を重ねたと言えます.成果を見てみましょう
========https git
https://github.com/spring-projects/spring-framework
Buiding from source
The Spring Frame ebook uses a Graadle-based build system.In the instructions below,
prerequisites
Git and OpenJDK 8 early access build 100 or later
Be sure that your
check out sources
Run
Note:Per the prerequisites above,ensure that you have JDK 8 configred properly in your IDE.
install all spring-*jars into your local Maven cache
前言
Springのソースは前に読んだことがあります.主にIOCの部分を読んでいます.パソコンを変えたことに加えて、他の部分も見たいと思い、また来たことがある.SpringソースはGitHubに移転しました.
準備工作
GitとJDK 1.7+が必要です.最新のspring-frame ewarkはgradleでコンパイルしたので、gradleをダウンロードする必要があります.
ダウンロード
私はSpring 3.2.xバージョンをダウンロードしました.
git clone git://github.com/SpringSource/spring-framework.git
ソースコンパイル1、gradlew.batのjvmメモリ設定に関するパラメータを修正します.
元の設定:
set GRADLE_OPTS=-XX:MaxPermSize=1024m -Xmx1024m -XX:MaxHeapSize=256m %GRADLE_OPTS%
現在設定:set GRADLE_OPTS=-XX:MaxPermSize=512m -Xmx512m -XX:MaxHeapSize=256m %GRADLE_OPTS%
さもないと次のようなエラーがあります.Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine
2、cmdでspring-frame ewarkディレクトリに入り、gradlew.bat build -x test
を実行して、すべてのテストをスキップします.テストはいつも失敗するので、spring-oxmのテストケースに問題があり、コンパイルが失敗しました.3、すべてのスプリング-jarsを地元のMaven cacheにインストールし、
gradlew.bat install
を実行します.4、ソースコードをeclipseに導入する.
4.1、cmdウィンドウ実行コマンド
gradlew.bat cleanEclipse :spring-oxm:compileTestJava eclipse -x :eclipse
4.2、eclipse File>Import...>Existing Project into Workspaceによって、すべてのsprigFraameworkプロジェクトを導入する.4.3、cmdウィンドウで
gradlew.bat :eclipse
を実行する.4.4、eclipse File>Import...>Existing Projects into WorkspaceによってsprigFraamework親プロジェクトを導入する.
締め括りをつける
全過程は苦労を重ねたと言えます.成果を見てみましょう
========https git
https://github.com/spring-projects/spring-framework
Buiding from source
The Spring Frame ebook uses a Graadle-based build system.In the instructions below,
./gradlew
is invoked from the source tre and serves as a cross-plot form,self-containd boot the strame form.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 extraced from the JDK download.check out sources
git clone git://github.com/SpringSource/spring-framework.git
import sources into your IDERun
./import-into-eclipse.sh
or read import-into-idea.md
as apprate.Note:Per the prerequisites above,ensure that you have JDK 8 configred properly in your IDE.
install all spring-*jars into your local Maven cache
./gradlew install
comple and test、build all jars、distribution zps and docs./gradlew build
…and discover more command with ./gradlew tasks
.See also the Grade build and release FAQ.