Compiling the spring-cloud-gcp-1.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.
- Download the spring-cloud-gcp-1.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-gcp.git
- Switch to the target version.
1 2
cd spring-cloud-gcp git checkout v1.2.1.RELEASE
- Configure the google-cloud-sdk Yum source. (If the current environment does not require a proxy to access the network, skip this step.)
- Back up the Yum source.
mkdir -p /etc/yum.repos.d/bak/ mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/bak/
- Create the google-cloud-sdk.repo file.
1vim /etc/yum.repos.d/google-cloud-sdk.repo - Press i to enter the insert mode and add the following content to the file:
[google-cloud-sdk] name=Google Cloud SDK baseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el7-x86_64 enabled=1 gpgcheck=0 repo_gpgcheck=1 gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg sslverify=false
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Make the Yum source take effect.
1 2
yum clean all yum makecache
- Back up the Yum source.
- Install google-cloud-sdk, google-cloud-sdk-pubsub-emulator, and google-cloud-sdk-datastore-emulator. (If the current environment does not require a proxy to access the network, skip this step.)
1yum install -y google-cloud-sdk google-cloud-sdk-pubsub-emulator google-cloud-sdk-datastore-emulator

If the error message "(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)" is reported during the compilation, run the following command:
yum install -y google-cloud-sdk google-cloud-sdk-pubsub-emulator google-cloud-sdk-datastore-emulator --nobest
- Complete the initialization. (If the current environment does not require a proxy to access the network, skip this step.)
1gcloud init
- When you run the gcloud command to initialize the environment, you need to log in to your Google account. Register a Google account if you do not have one.
- If the compilation environment needs to use proxy to access the Google website, copy the link to the browser, and enter the verification code to perform initialization, as shown in the following figure.
If "Enter project id you would like to use" is displayed, enter spring-cloud-gcp.
- If you have logged in using a Google account, select the Google account.
- Start datastore and pubsub. (If the current environment does not require a proxy to access the network, skip this step.)
1 2
gcloud beta emulators datastore start --host-port localhost:8181 & gcloud beta emulators pubsub start --host-port localhost:8085 &
- Replace the JAR package.
During the compilation, the grpc-netty-shaded-1.23.0.jar package is pulled. This JAR package does not contain SO files of the ARM64 architecture and you need to replace the JAR package.
- Create the library directory ~/.m2/repository/io/grpc/grpc-netty-shaded/1.23.0/.
1mkdir -p ~/.m2/repository/io/grpc/grpc-netty-shaded/1.23.0/
- Obtain the grpc-netty-shaded-1.23.0.jar package.
1wget https://mirrors.huaweicloud.com/kunpeng/maven/io/grpc/grpc-netty-shaded/1.23.0/grpc-netty-shaded-1.23.0.jar --no-check-certificate
- Copy the downloaded JAR package to the library directory.
1cp grpc-netty-shaded-1.23.0.jar ~/.m2/repository/io/grpc/grpc-netty-shaded/1.23.0/
- Create the library directory ~/.m2/repository/io/grpc/grpc-netty-shaded/1.23.0/.
- Perform the compilation.
1./mvnw clean install -Dgpg.skip=true

If BUILD SUCCESS is displayed, the compilation is successful.
- If the error message "GcpDatastoreEmulatorIntegrationTests" is reported during the compilation, rectify the fault by following instructions in spring-cloud-gcp Error.
- 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.
- If the compilation process is suspended, you are advised to restart the server, mount the drive to the compilation directory, and then perform 6 (optional) and 8.
- After the compilation is complete, disable the datastore and pubsub services.
1pkill -9 java
