4

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?

tribbloid
  • 4,026
  • 14
  • 64
  • 103

2 Answers2

1

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

CamW
  • 3,223
  • 24
  • 34
1

I had the same issue, it was only happening in my Mac machine (which is using Apple M1 chip) and it is a problem with the dependency. I solved the issue by explicitly adding the newest dependency:

implementation("io.netty:netty-transport-native-epoll:4.1.84.Final")
hfc
  • 614
  • 1
  • 5
  • 13