如何根据执行 maven 的 VM 是 32 位还是 64 位 JVM 来启用或禁用 maven 配置文件?
我试过这个:
<activation>
<os>
<arch>x86</arch>
</os>
</activation>
或 amd64
分别检测 32/64 位 VM,但这在 64 位 Windows 上运行的 32 位 VM 上失败,因为它激活 64 位配置文件。
最佳答案
在 Sun VM 中,
检查系统属性 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>
引用:
关于java - Maven:找出是在 32 位还是 64 位 JVM 中运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2854882/