Compiling and Installing Spring Framework
- Download the Spring Framework source code.
1 2 3
cd /home git config --global http.sslVerify false git clone https://github.com/spring-projects/spring-framework.git
If the git clone command fails to be executed, replace github.com with github.com.cnpmjs.org.
- Go to the source code directory and switch to the specified version. (v5.2.x can be v5.2.2 or v5.2.6.)
1 2
cd spring-framework git checkout v5.2.x.RELEASE
- Configure Gradle.
- Open the gradle-wrapper.properties file.
1vim gradle/wrapper/gradle-wrapper.properties - Press i to go to the insert mode, comment out line 3, and add the following content to line 4:
distributionUrl=gradle-5.6.4-bin.zip

- Press Esc, type :wq!, and press Enter to save the file and exit.
- Download the Gradle source code.
1wget https://services.gradle.org/distributions/gradle-5.6.4-bin.zip --no-check-certificate
- Move the gradle-5.6.4-bin.zip source package to the gradle/wrapper/ directory.
1mv gradle-5.6.4-bin.zip gradle/wrapper/
- Open the gradle-wrapper.properties file.
- Optional: Configure Cntlm.
If a proxy is required for the server to access the Internet, configure Cntlm. For details, see Configuring Cntlm.
- Perform the compilation.
cd /home/spring-framework ./gradlew build

If BUILD SUCCESSFUL is displayed, the compilation is successful.
On CentOS 7.6/openEuler 20.03:
- If an error message is displayed stating "validity check failed", see "certificate signed by unknown authority" Displayed When Installing Gox and Importing the Certificate.
- If an error message is displayed stating "unable to find valid certification path to requested target", see "certificate signed by unknown authority" Displayed When Installing Gox and Importing the Certificate. If the error message persists, restart the server and run the following commands:
1 2
/opt/cntlm/bin/cntlm -c /opt/cntlm/etc/cntlm.conf source /etc/profile
- If an error message is displayed stating "OutOfMemoryError thrown from UncaughtExceptionHandler", see OutOfMemoryError Reported When Compiling Spring Framework.
On CentOS 8.1:
- During the compilation, an error is reported due to gradle-enterprise-conventions.jar. For details about how to handle the error, see gradle-enterprise-conventions Error Reported When Compiling Spring-framework.
Parent topic: Spring-Framework Porting Guide