maven中的os.detected.classifier如何得到

1)随便建一个class,main中写:

System.out.println(System.getProperty("os.name"));
System.out.println(System.getProperty("os.arch"));

执行后得到类似:

Windows
amd64

2)然后打开网页:

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

很清楚,os.detected.classifier由os.detected.name和os.detected.arch决定。

os.detected.name和os.detected.arch都有相应的值对应:

查看 Windows和amd64对应的值,在 pom.xmlproperties 中新增:

<os.detected.classifier>windows-x86_64</os.detected.classifier>

就可以在maven中使用${os.detected.classifier}啦,不会报错了。

 

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章