前言
项目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
这些值怎么来?来干货
Linuxuname -s -m