Rate This Document
Findability
Accuracy
Completeness
Readability

Compiling and Installing WireMock

  1. Go to the wiremock-2.25.1 directory.
    1
    cd /home/wiremock-2.25.1
    
  2. Configure Gradle.
    1. Open the gradle-wrapper.properties file.
      1
      vim gradle/wrapper/gradle-wrapper.properties
      
    2. 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
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
    4. Download the Gradle source code.
      1
      wget https://services.gradle.org/distributions/gradle-4.10.2-all.zip --no-check-certificate
      
    5. Move the gradle-4.10.2-all.zip source package to the gradle/wrapper/ directory.
      1
      mv gradle-4.10.2-all.zip gradle/wrapper/
      
  3. Configure Cntlm.

    If a proxy is required for the server to access the Internet, configure Cntlm. For details, see Configuring Cntlm.

  4. 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.
  5. Replace the conscrypt-openjdk-uber-2.1.0.jar package in the local repository of Gradle.
    1. Obtain the conscrypt-openjdk-uber-2.1.0.jar package.
      1
      wget https://mirrors.huaweicloud.com/kunpeng/maven/org/conscrypt/conscrypt-openjdk-uber/2.1.0/conscrypt-openjdk-uber-2.1.0.jar  --no-check-certificate
      

      For details about how to port the conscrypt-openjdk-uber-2.1.0.jar of the ARM version, see conscrypt-openjdk-uber-2.1.0.jar Porting Guide.

    2. 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/
      
  6. Perform the compilation and installation again.
    1
    ./gradlew -c release-settings.gradle :java8:shadowJar
    

    If BUILD SUCCESSFUL is displayed, the compilation is successful.

  7. View the generated JAR package.
    ls java8/build/libs/