Jenkins中的Maven在解析io.netty:netty-transport-native-epoll时出错



我得到这个错误,而试图建立我的项目在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]

看起来主要是因为${os.detected.name}-${os.detected.arch}被添加到链接中,我已经检查了没有这些变量的jar在Nexus中可用,问题只出现在运行在Debian中的Jenkins中,而不是在我的windows机器上(具有相同的settings.xml文件和相同的POM.xml),构建在windows上没有问题,但在linux上没有问题。我尝试在jenkines的maven中添加-X进行调试,我可以在控制台输出中看到这样:

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

但是,当试图解决依赖关系时,这不会添加到链接中:

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

我使用Jenkins的Maven是Apache Maven 3.3.9,奇怪的是这个问题没有出现在Windows中。这里,有一个linux的repo链接,我已经添加到maven,但这些变量仍然没有在链接中改变,这就是为什么下载失败,有什么想法吗?

我已经解决了这个问题,因为我应该添加netty-all而不是netty microbench,所以添加这个依赖项解决了这个问题

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

最新更新