Rate This Document
Findability
Accuracy
Completeness
Readability

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.

  1. This project must be compiled by a non-root user. If no non-root user has been created, add a user first.
    1. Add a non-root user.
      1
      useradd springcloudtester
      
    2. Change the user password.
      passwd springcloudtester
    3. 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.

      1
      cd /home/springcloudtester
      
  2. 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
  3. 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
    
  4. Switch to the target version.
    1
    git checkout v2.2.1.RELEASE
    
  5. Switch to a non-root user.
    1
    su springcloudtester
    
  6. 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.
    1. Create a library directory ~/.m2/repository/it/ozimov/embedded-redis/0.7.2/.
      1
      mkdir -p ~/.m2/repository/it/ozimov/embedded-redis/0.7.2/
      
    2. Obtain the JAR package.
      1
      wget https://mirrors.huaweicloud.com/kunpeng/maven/it/ozimov/embedded-redis/0.7.2/embedded-redis-0.7.2.jar  --no-check-certificate
      
    3. Copy the embedded-redis-0.7.2.jar package to the created library directory.
      1
      cp embedded-redis-0.7.2.jar ~/.m2/repository/it/ozimov/embedded-redis/0.7.2/
      
  7. 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.

  8. Switch to the root user.
    su -