0. Prepare the environment

Before You Start

To build you will need Git and JDK 8 update 262 or later. Update 262 or later is required due to the dependency on Java Flight Recorder (JFR) types. Note, however, that Oracle JDKs do not include the JFR types. Thus, we recommend an AdoptOpenJDK distribution or similar that includes the JFR types. Be sure that your JAVA_HOME environment variable points to the jdk1.8.0 folder extracted from the JDK download.

If it is JDK8, be careful if the smaller version meets the requirements

It is best to choose a higher level version of OpenJDK

AdoptOpenJDK:adoptopenjdk.net/

1. DownloadSpring FrameworkThe source code

Github Spring Framework Releases:Github.com/spring-proj…

It is best to chooseRELEASEversion

After selecting the version, download it directlyzipPackage can be


Build from Source:Github.com/spring-proj…

Import into your IDE:Github.com/spring-proj…

2. Unpack and editbuild.gradlefile

At the top buildScript {… } to add the aliyun Maven mirror address

Gradle file in the new version of the source code does not have this paragraph, can not add

buildscript { repositories { maven{ url 'https://maven.aliyun.com/nexus/content/groups/public/' } maven{ url 'https://maven.aliyun.com/nexus/content/repositories/jcenter' } } dependencies { classpath 'org. Asciidoctor: asciidoctorj - PDF: 1.5.0 - alpha. 16' classpath 'IO. Spring. Asciidoctor: spring - asciidoctor - extensions: 0.1.3. RELEASE'}}Copy the code

In the configure (allprojects) {… }, find Repositories {… }, also add the aliyun Maven mirror address

repositories {
    maven{ url 'https://maven.aliyun.com/nexus/content/groups/public/' }
    maven{ url 'https://maven.aliyun.com/nexus/content/repositories/jcenter' }
    mavenCentral()
    maven { url "https://repo.spring.io/libs-spring-framework-build" }
}
Copy the code

3. The compilation of the spring oxm. –

Open the cli tool, go to the decompressed folder, and run the command./gradlew :spring-oxm:compileTestJava

wuxl_@wuxl_deiMac spring-Framework - 5.2.0.release %./gradlew :spring-oxm:compileTestJava... . BUILD SUCCESSFUL in 2m 9sCopy the code

Compile in two or three minutes

BUILD SUCCESSFUL indicates that the compilation is SUCCESSFUL

If a compilation error occurs, do your own search for a solution based on the error, which varies from machine to machine.

4. Import the source code to idea development tool

Once compiled, you can import the source code into your development tools

Import Project -> Go to source directory -> Select Gradle

New idea does not import project option, directly select open, select the source directory can be.

After importing the project, compilation also takes a long time…

I compiled it in 16 minutes

BUILD SUCCESSFUL in 16m 27s

5.spring-aspects

If your Spring-Aspects project has code errors, remove the project

Select the Spring-Aspects project, right click Load/Unload Modules and click Unload >, OK

Then Build -> Rebuild Project.

This is just the first step