Rate This Document
Findability
Accuracy
Completeness
Readability

Compiling the spring-cloud-gateway-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. Download the spring-cloud-gateway-2.2.1.RELEASE source package.
    1
    2
    3
    cd /home
    git config --global http.sslVerify false
    git clone https://github.com/spring-cloud/spring-cloud-gateway.git
    
  2. Switch to the target version.
    1
    2
    cd spring-cloud-gateway
    git checkout v2.2.1.RELEASE
    
  3. Replace the embedded-redis-0.6.jar package obtained during the compilation with its ARM version.
    • The embedded-redis-0.6.jar package supports only the x86 architecture, which will cause compilation errors. You need to replace the embedded-redis-0.6.jar package in the local Maven repository with that of the ARM version.
    • You can download the embedded-redis-0.6.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/com/github/kstyrc/embedded-redis/0.6/.
      1
      mkdir -p ~/.m2/repository/com/github/kstyrc/embedded-redis/0.6/
      
    2. Obtain the embedded-redis-0.6.jar package.
      1
      wget https://mirrors.huaweicloud.com/kunpeng/maven/com/github/kstyrc/embedded-redis/0.6/embedded-redis-0.6.jar --no-check-certificate
      
    3. Copy the downloaded JAR package to the library directory.
      1
      cp embedded-redis-0.6.jar ~/.m2/repository/com/github/kstyrc/embedded-redis/0.6/embedded-redis-0.6.jar
      
  4. Perform the compilation.
    1
    ./mvnw clean install -Dgpg.skip=true
    

    If BUILD SUCCESS is displayed, the compilation is successful.

    • If the error message "Some problems were encountered while processing the POMs" is displayed, run the following command:
      mvn clean install -Dgpg.skip=true
    • If an error is reported during the compilation due to checkstyle, rectify the fault by following instructions in "Failed during checkstyle execution" Displayed When Compiling Spring Boot.
    • If the error message "Spring Cloud Gateway Core.......................... FAILURE" and "No content, 404 NOT_FOUND Not Found" are displayed, the proxy is faulty. Retry the compilation for several times.
    • If the RetryGatewayFilterFactoryIntegrationTests error is reported during compilation, the network environment is faulty. Rectify the error by following instructions in spring-cloud-gateway Error.

      If the compilation still fails after the operations in are performed based on spring-cloud-gateway Error, the possible cause is that the read and write capabilities of old HDDs are weak. As a result, the service processing latency is long. You are advised to use drives with better performance, such as SSDs, for service verification.