Rate This Document
Findability
Accuracy
Completeness
Readability

Failed to Obtain netty-transport-native-epoll

Symptom

During the compilation, the message "Could not find artifact io.netty:netty-transport-native-epoll:jar:linux-aarch_64:4.1.43.Final..." is displayed, indicating that the libnetty_transport_native_epoll_aarch_64.so file is missing.

Key Process and Cause Analysis

Some components in Spring Cloud, such as spring-cloud-gateway, spring-cloud-gcp, and spring-cloud-contract, will pull the netty-transport-native-epoll-4.1.43.Final-linux-x86_64.jar package during the compilation. Currently, mainstream Maven repositories do not have the JAR package of the Arm64 architecture. Therefore, the libnetty_transport_native_epoll_aarch_64.so package may be missing.

Conclusion and Solution

Save the netty-transport-native-epoll-4.1.43.Final-linux-aarch_64.jar package of the Arm64 version to the local Maven repository.

  1. Create a /root/.m2/repository/io/netty/netty-transport-native-epoll/4.1.43.Final directory if the directory does not exist.
    mkdir -p /root/.m2/repository/io/netty/netty-transport-native-epoll/4.1.43.Final
  2. Obtain the netty-transport-native-epoll-4.1.43.Final-linux-aarch_64.jar package.

    You can also compile the JAR package by referring to netty-transport-native-epoll-4.1.43.Final-linux-aarch_64.jar Porting Guide.

    wget https://mirrors.huaweicloud.com/kunpeng/maven/io/netty/netty-transport-native-epoll/4.1.43.Final/netty-transport-native-epoll-4.1.43.Final-linux-aarch_64.jar --no-check-certificate
  3. Save the JAR package to the local Maven repository.
    \cp netty-transport-native-epoll-4.1.43.Final-linux-aarch_64.jar /root/.m2/repository/io/netty/netty-transport-native-epoll/4.1.43.Final
  4. Add the dependency to the netty-transport-native-epoll-4.1.43.Final-linux-aarch_64.jar package.
    1. Open the pom.xml file.
      vim pom.xml
    2. Press i to enter the insert mode and add the following content below <dependencies>:
      <dependency>
          <groupId>io.netty</groupId>
          <artifactId>netty-transport-native-epoll</artifactId>
          <version>4.1.43.Final</version>
          <classifier>linux-aarch_64</classifier>
          <scope>compile</scope>
          <exclusions>
              <exclusion>
                      <artifactId>commons-logging</artifactId>
                      <groupId>commons-logging</groupId>
              </exclusion>
          </exclusions>
      </dependency>
  5. Press Esc, type :wq!, and press Enter to save the file and exit.
  6. Recompile Spring Cloud.