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.xml 的 properties 中新增:
<os.detected.classifier>windows-x86_64</os.detected.classifier>
就可以在maven中使用${os.detected.classifier}啦,不会报错了。