Compiling the spring-cloud-config-2.2.1.RELEASE Source Code
The binary packages available at the Kunpeng mirror site are compiled and packaged based on the open source code, and do not involve vulnerability or bug fixes.
When using open source software, comply with the applicable license.
- This project must be compiled by a non-root user. If no non-root user has been created, add a user first.
- Add a non-root user.
1useradd springcloudtester - Change the user password.
passwd springcloudtester
- Switch to the root directory of the user.
The root directory of the user is in the /home directory. For example, the root directory of the springcloudtester user added in 1.a is /home/springcloudtester.
1cd /home/springcloudtester
- Add a non-root user.
- Obtain the source code.
Download the spring-cloud-config-2.2.1.RELEASE source code in the root directory of the created non-root user.
git config --global http.sslVerify false git clone https://github.com/spring-cloud/spring-cloud-config.git
- Change the owner of the source code directory.Change the owner of the spring-cloud-config directory to the created non-root user and go to the directory.
1 2
chown -R springcloudtester:springcloudtester spring-cloud-config cd spring-cloud-config
- Switch to the target version.
1git checkout v2.2.1.RELEASE
- Switch to a non-root user.
1su springcloudtester - Replace the embedded-redis-0.7.2.jar package obtained during the compilation with its ARM version.
- The embedded-redis-0.7.2.jar package supports only the x86 architecture, which will cause compilation errors. You need to replace the embedded-redis-0.7.2.jar package in the local Maven repository with that of the ARM version.
- You can download the embedded-redis-0.7.2.jar package of the ARM version from the Huawei Kunpeng mirror site or compile the package by following instructions in embedded-redis Porting Guide. This document describes how to download the package from the mirror site.
- Create a library directory ~/.m2/repository/it/ozimov/embedded-redis/0.7.2/.
1mkdir -p ~/.m2/repository/it/ozimov/embedded-redis/0.7.2/
- Obtain the JAR package.
1wget https://mirrors.huaweicloud.com/kunpeng/maven/it/ozimov/embedded-redis/0.7.2/embedded-redis-0.7.2.jar --no-check-certificate
- Copy the embedded-redis-0.7.2.jar package to the created library directory.
1cp embedded-redis-0.7.2.jar ~/.m2/repository/it/ozimov/embedded-redis/0.7.2/
- Perform the compilation.
1./mvnw clean install -Dgpg.skip=true

If BUILD SUCCESS is displayed, the compilation is successful.
If an error is reported during compilation, run the su - command to switch to the root user. Then run the cd /home/springcloudtester/spring-cloud-config command to switch to the directory. Refer to the following solution to rectify the fault. After that, run the su springcloudtester command to switch to a non-root user and perform compilation again.
- If apache-maven-3.5.0-bin.zip fails to be downloaded, rectify the fault by following instructions in mvnw Command Failed to Pull apache-maven.
- If an error is reported during the compilation due to checkstyle-plugin, rectify the fault by following instructions in "Failed during checkstyle execution" Displayed When Compiling Spring Boot.
- Switch to the root user.
su -