Spring Source Learning One _ Download Spring project source code and compile to eclipse
1. Download Spring Source
git:https://github.com/springsource/spring-framework/
2. Prerequisites to be met before compiling after the download is complete
1) The current system is installed Gradle, if for installation, can be from: http://www.gradle.org/downloads, select a version to download
2) The current system is installed OPENJDK 8 early access build or later, click on the link to download. After installation, you will also need to confirm that the JAVA_HOME environment variable points to the newly installed JDK8
3) In view of the previous experience of compiling hibernate, it is recommended to modify the regional language to "English (United Kingdom)" to prevent character encoding errors during the compilation process.
3. Run the compile command to compile the code into an Eclipse project
1) Switch the root of the current spring code at the command line
CD C:\Users\Administrator\Documents\GitHub\spring-framework
2) Run Import-into-eclipse.bat, this time is not directly run Gradlew.bat, but open Import-into-eclipse.bat can see, in fact, its internal or call Gradlew, such as:
72 Row Set Command=gradlew:eclipse
90 Line Call%command%
3) You will be prompted to install the spring STS at compile time.
Http://springsource.org/downloads/sts
Select the appropriate version to download, I choose to download the 32-bit ZIP version based on eclipse KEPLER 4.3
For:
Http://download.springsource.com/release/STS/3.3.0/dist/e4.3/spring-tool-suite-3.3.0.RELEASE-e4.3-win32.zip
Direct ENTER to confirm
4) You will then be prompted to run the following command:
./gradlew Cleaneclipse:spring-oxm:compiletestjava Eclipse-x: Eclipse
Direct Enter Confirmation
5) Next, the required dependencies will be downloaded automatically, waiting for their download and compilation to complete.
During the compilation process, the first compilation stuck in the "> Building >: Spring-core:cglibrepackjar" This hint for a long time, look at the cmd process, seemingly dead, I will end up running again, still stay in this place.
Note: During the compilation process, there are often no responses to download dependencies, you need to find the corresponding Java process, run it again, or close the command-line window again, no specific reason is found.
Guessing should be related to my network condition and the Java environment, which is the problem with the 32-bit and 64-bit versions of JDK8 that were tried during the compilation.
After the compilation is unsuccessful, I run Gradlew.bat install, try to first download all the dependencies, in the process of downloading the dependencies related to the subproject, there will still be no response to the command, you can only shut down and rerun again and again.
After compiling the fake one after another, I finally saw the "BUILD SUCCESS", Running Import-into-eclipse.bat again, this run, skipping a lot of dependencies that need to be downloaded before, should have been downloaded when running the install command, but there are still some dependencies that need to be downloaded. Observing the output, you will find that the pom file corresponding to the dependency is downloaded first, and then the corresponding jar is downloaded. It should be related to MAVEN and have time to look at Maven, Ant, Ivy, Gradle.
-----------------------------------------------Split Line---------------------------------------------------
After returning home, download source from GitHub, compile to eclipse project, do not have the above problem, therefore, can think that multiple compile interrupt is caused by network, in addition, if Gradle is not installed locally, compile will download automatically, but jdk8 still need to install beforehand. I previously installed gradle1.7, and spring uses greadle1.6 by default, and it is not yet possible to confirm whether it is related to the Gradle version.
How to make a jar package of source code downloaded from GitHub (take spring for example)