如何根据执行maven的虚拟机是32位还是64位来启用或禁用maven配置文件?
我尝试了以下方法:
<activation>
<os>
<arch>x86</arch>
</os>
</activation>
为了检测32/64位的虚拟机,可以使用i386
或amd64
参数,但在64位Windows上运行的32位虚拟机上,这种方法会激活64位配置文件,因此无法正常工作。
sun.arch.data.model
。<profiles>
<profile>
<id>32bitstuff</id>
<activation>
<property>
<name>sun.arch.data.model</name>
<value>32</value>
</property>
</activation>
</profile>
<profile>
<id>64bitstuff</id>
<activation>
<property>
<name>sun.arch.data.model</name>
<value>64</value>
</property>
</activation>
</profile>
</profiles>
参考文献: