Compiling the spring-cloud-contract-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.
- Download the spring-cloud-contract-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-contract.git
- Switch to the target version.
1 2
cd spring-cloud-contract git checkout v2.2.1.RELEASE
- Replace the wiremock-jre8-standalone-2.25.1.jar package.
- The WireMock project depends on conscrypt-openjdk-uber-2.1.0.jar, but the .so file that adapts to the ARM64 architecture is missing. As a result, an error is reported. You need to replace wiremock-jre8-standalone-2.25.1.jar in the local Maven repository.
- You can download the wiremock-jre8-standalone-2.25.1.jar package from the Huawei mirror site or compile it by following instructions in wiremock-jre8-standalone-2.25.1.jar Porting Guide. This document uses the method of downloading the package from the mirror site as an example.
- Create a library directory ~/.m2/repository/com/github/tomakehurst/wiremock-jre8-standalone/2.25.1/.
1mkdir -p ~/.m2/repository/com/github/tomakehurst/wiremock-jre8-standalone/2.25.1/
- Obtain the wiremock-jre8-standalone-2.25.1.jar package.
1wget https://mirrors.huaweicloud.com/kunpeng/maven/com/github/tomakehurst/wiremock-jre8-standalone/2.25.1/wiremock-jre8-standalone-2.25.1.jar --no-check-certificate
- Copy the downloaded JAR package to the library directory.
1cp wiremock-jre8-standalone-2.25.1.jar ~/.m2/repository/com/github/tomakehurst/wiremock-jre8-standalone/2.25.1/
- Replace the hoverfly-junit-0.2.2.jar package.
- During the compilation, the hoverfly-junit-0.2.2.jar package is obtained. This JAR package does not contain the hoverfly binary file of the ARM64 architecture. Therefore, you need to replace the hoverfly-junit-0.2.2.jar package in the local Maven repository.
- You can download the hoverfly-junit-0.2.2.jar package from the Huawei Kunpeng mirror site or compile the package by following instructions in hoverfly-junit-0.2.2.jar Porting Guide. This document uses the method of downloading the package from the mirror site.
- Create a library directory ~/.m2/repository/io/specto/hoverfly-junit/0.2.2/.
1mkdir -p ~/.m2/repository/io/specto/hoverfly-junit/0.2.2/
- Obtain the hoverfly-junit-0.2.2.jar package.
1wget https://mirrors.huaweicloud.com/kunpeng/maven/io/specto/hoverfly-junit/0.2.2/hoverfly-junit-0.2.2.jar --no-check-certificate
- Copy the downloaded JAR package to the library directory.
1cp hoverfly-junit-0.2.2.jar ~/.m2/repository/io/specto/hoverfly-junit/0.2.2/
- View the JAR file.
jar tvf ~/.m2/repository/io/specto/hoverfly-junit/0.2.2/hoverfly-junit-0.2.2.jar
- Decompress the JAR package to a specified directory.
unzip ~/.m2/repository/io/specto/hoverfly-junit/0.2.2/hoverfly-junit-0.2.2.jar -d ~/.m2/repository/io/specto/hoverfly-junit/0.2.2/hoverfly-junit-0.2.2
- Switch to the directory generated after the decompression and rename hoverfly_v0.9.1_linux_arm64 to hoverfly_v0.9.1_linux_amd64.
cd ~/.m2/repository/io/specto/hoverfly-junit/0.2.2/hoverfly-junit-0.2.2 && mv hoverfly_v0.9.1_linux_arm64 hoverfly_v0.9.1_linux_amd64
- Compress all files in the current directory into a new JAR package.
jar cvf ../hoverfly-junit-0.2.2.jar -c ./*
- Perform the compilation.
1 2
cd /home/spring-cloud-contract ./mvnw clean install -Dgpg.skip=true

If BUILD SUCCESS is displayed, the compilation is successful.
- If the error message "spring-cloud-contract-stub-runner" is reported during the compilation, rectify the fault by following instructions in Symptom.
- If the error message "Failed during checkstyle execution" is reported during the compilation, rectify the fault by following instructions in "Failed during checkstyle execution" Displayed When Compiling Spring Boot.
- If the compilation environment needs to use proxy to access the Internet, configure the proxy by following instructions in Conclusion and Solution. Otherwise, Spring-Cloud-Contract-Gradle-Plugin may report an error.
Parent topic: Compiling and Installing Spring Cloud