Hasson
Hasson

Reputation: 1914

Error in Maven in Jenkins while resolving for io.netty:netty-transport-native-epoll

I am getting this error while trying to build my project in Jenkins:

[ERROR] Failed to execute goal on project MyProject: 
Could not resolve dependencies for project com.example:MyProject:jar:0.0.2-SNAPSHOT: 
Could not transfer artifact io.netty:netty-transport-native-epoll:jar:${os.detected.name}-${os.detected.arch}:4.1.4.Final
from/to nexus (http://nexus.example.com:8081/repository/maven-public/):
Failed to transfer file:
http://nexus.example.com:8081/repository/maven-public/io/netty/netty-transport-native-epoll/4.1.4.Final/netty-transport-native-epoll-4.1.4.Final-$%7Bos.detected.name%7D-$%7Bos.detected.arch%7D.jar.
Return code is: 500 , ReasonPhrase:Server Error. -> [Help 1]

It looks it is mainly because ${os.detected.name}-${os.detected.arch} is added to the link, I have checked that the jar is available in Nexus without these variables, the problem appears only in Jenkins which runs in Debian, but not on my windows machine (which has the same settings.xml file and the same POM.xml) the build works fine with no problems on windows, but not on linux. I have tried to add -X to maven in jenkines to debug, I can see in the consol output this:

OS name: "linux", version: "3.16.0-4-amd64", arch: "amd64", family: "unix"

But this is not added to the link while trying to resolve the dependency which is:

<dependency>
    <groupId>io.netty</groupId>
    <artifactId>netty-microbench</artifactId>
    <version>4.1.5.Final</version>
</dependency>

Maven which I am using with Jenkins is Apache Maven 3.3.9, the strange thing is that this problem do not show up in Windows. Here, there is a repo link for linux, I have added that to maven, but still these varaibles are not changed in the link and that's why the download failes, any ideas?

Upvotes: 0

Views: 2707

Answers (1)

Hasson
Hasson

Reputation: 1914

I have resolved the issue as I should have added netty-all rather than netty microbench, so adding this dependency solved the issue

  <dependency>
    <groupId>io.netty</groupId>
    <artifactId>netty-all</artifactId> 
    <version>4.1.5.Final</version>
  </dependency> 

Upvotes: 1

Related Questions