Compiling and Installing WireMock
- Go to the wiremock-2.25.1 directory.
1cd /home/wiremock-2.25.1
- Configure Gradle.
- Open the gradle-wrapper.properties file.
1vim gradle/wrapper/gradle-wrapper.properties - Press i to go to the insert mode, comment out line 6, and add the following content to line 7:
distributionUrl=gradle-4.10.2-all.zip
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Download the Gradle source code.
1wget https://services.gradle.org/distributions/gradle-4.10.2-all.zip --no-check-certificate
- Move the gradle-4.10.2-all.zip source package to the gradle/wrapper/ directory.
1mv gradle-4.10.2-all.zip gradle/wrapper/
- Open the gradle-wrapper.properties file.
- Configure Cntlm.
If a proxy is required for the server to access the Internet, configure Cntlm. For details, see Configuring Cntlm.
- Perform the compilation and installation.
1./gradlew -c release-settings.gradle :java8:shadowJar
If BUILD SUCCESSFUL is displayed, the compilation is successful.
- Error 1: If an error message is reported stating "Exception in thread "main" java.net.UnkownHostException:services.gradle.org...", see Failed to Download Gradle.
- Error 2: If an error message is reported stating "gyp ERR! stack Error: self signed certificate in certificate chain", run the following commands:
npm config set strict-ssl false npm config list
- Error 3: If an error message is reported stating "npm ERR! 502 Parent proxy unreacheable", the network proxy cannot obtain resources. You are advised to change the network environment.
- Error 4: If an error message is reported stating "validity check failed", see Configure the Certificate. If the error persists, see Importing the Certificate.
- Replace the conscrypt-openjdk-uber-2.1.0.jar package in the local repository of Gradle.
- Obtain the conscrypt-openjdk-uber-2.1.0.jar package.
1wget https://mirrors.huaweicloud.com/kunpeng/maven/org/conscrypt/conscrypt-openjdk-uber/2.1.0/conscrypt-openjdk-uber-2.1.0.jar --no-check-certificate
- Replace the conscrypt-openjdk-uber-2.1.0.jar package.
1\cp conscrypt-openjdk-uber-2.1.0.jar /root/.gradle/caches/modules-2/files-2.1/org.conscrypt/conscrypt-openjdk-uber/2.1.0/76415837a98c80fe5a5ed18e05085b39bcc1d673/
- Obtain the conscrypt-openjdk-uber-2.1.0.jar package.
- Perform the compilation and installation again.
1./gradlew -c release-settings.gradle :java8:shadowJar
If BUILD SUCCESSFUL is displayed, the compilation is successful.
- View the generated JAR package.
ls java8/build/libs/
