我要评分
获取效率
正确性
完整性
易理解

Failed to Build BoringSSL During Compilation

Symptom

Failed to build BoringSSL during the compilation. The message "Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.8:run(build-boringssl)" is displayed.

Key Process and Cause Analysis

The go get command starts an automatic download of the specified installation package or related dependencies. However, packages like golang.org/x/... fail to be downloaded. Go 1.11 and later versions have the GOPROXY environment variable to set the proxy address of the Go module. If GOPROXY is configured, Go downloads the source code from the proxy address instead of directly from the code repository. The public proxy address is https://goproxy.io.

Conclusion and Solution

  1. View the Go version.
    go version
  2. Open the profile file.
    vim /etc/profile
  3. Press i to enter the insert mode and add the following content to the file:
    export GOPROXY=https://goproxy.io
    export GO111MODULE=on
  4. Press Esc, type :wq!, and press Enter to save the file and exit.
  5. Make the environment variables take effect.
    source /etc/profile
  6. View the environment variables.
    echo $GOPROXY
  7. Copy BoringSSL again.
    1. Go to the /home/netty-tcnative-netty-tcnative-parent-2.0.28.Final/boringssl-static/target/ directory.
      cd /home/netty-tcnative-netty-tcnative-parent-2.0.28.Final/boringssl-static/target/
    2. Delete the original boringssl-chromium-stable.
      du -sh boringssl-chromium-stable
      rm -rf boringssl-chromium-stable
    3. Copy the new boringssl-chromium-stable.
      cp -r /root/boringssl-chromium-stable 
      du -sh boringssl-chromium-stable
  8. Run the compile command again.
    mvn clean install