Rate This Document
Findability
Accuracy
Completeness
Readability

Compiling the spring-cloud-consul-2.2.1.RELEASE Source Code

  1. Download the spring-cloud-consul-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-consul.git
    
  2. Switch to the target version.
    1
    2
    cd spring-cloud-consul
    git checkout v2.2.1.RELEASE
    
  3. Download the Consul compressed file that adapts to the ARM architecture.

    Early versions of Consul are not adapted for the ARM architecture. However, the Consul version of the project main version has been updated to 1.7.2. Therefore, you only need to update the Consul version to 1.7.2 and add the correct architecture information to the downloaded script.

    1. Edit the travis_install_consul.sh file.
      1
      vim src/main/bash/travis_install_consul.sh
      
    2. Press i to enter the insert mode and modify the file.
      • In line 3, change the Consul version to 1.7.2.
      • In line 4, change the architecture information of Consul to arm64.

    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  4. Modify the local_run_consul.sh file.
    1. Open the local_run_consul.sh file.
      vim src/main/bash/local_run_consul.sh
    2. Press i to enter the insert mode and add the consul path to line 4.
      ${BASEDIR}/

      The travis_install_consul.sh script downloads Consul to the root directory. Therefore, you need to add the path of Consul to the local_run_consul.sh script.

    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  5. Perform the compilation.
    1
    2
    ./src/main/bash/travis_install_consul.sh
    ./src/main/bash/local_run_consul.sh & ./mvnw clean install -Dgpg.skip=true
    
    • The ampersand (&) ensures that the local_run_consul.sh script runs in the background.
    • If the error message "Some problems were encountered while processing the POMs" is displayed, run the following command:
      ./src/main/bash/local_run_consul.sh & mvn clean install -Dgpg.skip=true
    • If the error message "checkstyle" is reported during the compilation, rectify the fault by following instructions in "Failed during checkstyle execution" Displayed When Compiling Spring Boot.
    • If an error is reported when you run the travis_install_consul.sh script and the system prompts you to add --no-check-certificate, rectify the fault by following instructions in spring-cloud-consul Download Issue.

    If BUILD SUCCESS is displayed, the compilation is successful. You can stop the Consul process.

  6. After the compilation is complete, stop the Consul process started by local_run_consul.sh.
    1
    pkill -9 consul