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?