简体   繁体   中英

What have caused the problem of "Could not find netty-transport-native-epoll-4.1.76.Final-linux-x86_64.jar"?

I'm using Gradle shadow jar plugin to produce a fat jar for selenium. The following code is declared in Gradle kts:

dependencies {

    val seleniumV = "4.1.4"
    val phantomJSV = "1.5.0"
    val htmlUnitV = "3.61.0"

    // Selenium
    api("org.seleniumhq.selenium:selenium-api:${seleniumV}")
    api("org.seleniumhq.selenium:selenium-support:${seleniumV}")
}

tasks {
    shadowJar {
        exclude("META-INF/*.SF")
        exclude("META-INF/*.DSA")
        exclude("META-INF/*.RSA")
    }
}

It compiles successfully on my computer, but when being compiled on the cloud I encounter the following error:


FAILURE: Build failed with an exception.
02:23
* What went wrong:
02:23
Could not determine the dependencies of task ':repack:selenium-repack:shadowJar'.
02:23
> Could not resolve all files for configuration ':repack:selenium-repack:runtimeClasspath'.
02:23
   > Could not find netty-transport-native-epoll-4.1.76.Final-linux-x86_64.jar (io.netty:netty-transport-native-epoll:4.1.76.Final).
02:23
     Searched in the following locations:
02:23
         file:/home/rof/.m2/repository/io/netty/netty-transport-native-epoll/4.1.76.Final/netty-transport-native-epoll-4.1.76.Final-linux-x86_64.jar
02:23
   > Could not find netty-transport-native-kqueue-4.1.76.Final-osx-x86_64.jar (io.netty:netty-transport-native-kqueue:4.1.76.Final).
02:23
     Searched in the following locations:
02:23
         file:/home/rof/.m2/repository/io/netty/netty-transport-native-kqueue/4.1.76.Final/netty-transport-native-kqueue-4.1.76.Final-osx-x86_64.jar
02:23

Strangely, the jar in question "netty-transport-native-epoll-4.1.76.Final-linux-x86_64" can't be found on my computer either. The name appears to be automatically generated from the underlying OS that runs the build.

This problem also won't be triggered if the project is compiled using maven, with maven-shade-plugin.

What's the possible cause of this peculiar error and how to fix it?

epoll is a Linux-specific API that netty uses for native transport. kqueue is the same for MacOS.

Here is the wiki page for netty tcnative https://netty.io/wiki/forked-tomcat-native.html

As in the link above, you could consider including the uber jar which should contain everything netty-tcnative-boringssl-static

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM