Maven 编译打包 解决maven无法获取${os.detected.xxx}的问题

Maven 编译打包 解决maven无法获取${os.detected.xxx}的问题

前言

项目Jenkins打包一直报错,花几个小时查找问题,做好记录

错误如下

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  35.967 s
[INFO] Finished at: 2024-09-13T13:54:43+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project intelligent-system: Could not resolve dependencies for project com.yss.intelligent:intelligent-system:jar:1.0.0: The following artifacts could not be resolved: io.netty:netty-transport-native-unix-common:jar:${os.detected.name}-${os.detected.arch}:4.1.48.Final (absent), io.netty:netty-transport-native-epoll:jar:${os.detected.name}-${os.detected.arch}:4.1.48.Final (absent): Could not transfer artifact io.netty:netty-transport-native-unix-common:jar:${os.detected.name}-${os.detected.arch}:4.1.48.Final from/to dm (http://192.168.167.26:8081/repository/dm/): status code: 400, reason phrase: Invalid repository path (400) -> [Help 1]
[ERROR] 

解决方案如下

mvn -s $globalSettings -Dos.detected.name=linux -Dos.detected.arch=x86_64 -Dos.detected.classifier=linux-x86_64 -Dmaven.test.skip=true -Dfile.encoding=utf-8 clean package

划重点: -Dos.detected.name=linux -Dos.detected.arch=x86_64 -Dos.detected.classifier=linux-x86_64
这些值怎么来?来干货
Linux

uname -s -m
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值