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}啦,不會報錯了。

 

 

 

 

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