接触新的项目,构建时候报错:Failure to find io.netty:netty-tcnative:jar:${os.detected.classifier}:2.0.7.Final in

详细信息如下:

Failure to find io.netty:netty-tcnative:jar:${os.detected.classifier}:2.0.7.Final in http://mvn.com/libs-releases
 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]  

  

 

根据错误信息可以看出来是缺少os.detected.classifier属性所致,经过排查发现这个属性不是操作系统自身的属性,因此就需要使用-D传入,具体可以参考:

 

https://github.com/trustin/os-maven-plugin

 

里面说的很清楚:

 具体解决方案有两种,本质都是将属性值传给Maven的的JVM进程。

方案1:

因此根据上面链接拼接出你自己的操作系统的标志即可,我的是:

 

mvn  package -DskipTests  -Dos.detected.classifier=osx-x86_64

  

方案2:

配置JVM启动参数到环境变量:

export MAVEN_OPTS=-Dos.detected.classifier=linux-x86_64

  

参考:http://maven.apache.org/configure.html

 

posted @ 2019-04-29 17:42  bf378  阅读(5659)  评论(0编辑  收藏  举报