I want to set some properties based on the OS type, so I have the following in my pom.xml
:
<project ...>
<profiles>
<profile>
<id>KenMacbook</id>
<activation>
<os><family>mac</family></os>
</activation>
<properties>
<test.r.version>3.3</test.r.version>
</properties>
</profile>
<profile>
<id>LinuxBox</id>
<activation>
<os><family>unix</family></os>
</activation>
<properties>
<test.r.version>3.2</test.r.version>
</properties>
</profile>
</profiles>
...
</project>
On my Mac, I check what profiles are active:
% mvn help:active-profiles | grep -v INFO
Active Profiles for Project 'com.foo:bar:jar:2.0.3-SNAPSHOT':
The following profiles are active:
- nexus (source: external)
- KenMacbook (source: com.foo:bar:2.0.3-SNAPSHOT)
- LinuxBox (source: com.foo:bar:2.0.3-SNAPSHOT)
So it looks like the <activation>
for the LinuxBox
profile isn't successfully excluding that profile on Mac. Am I misunderstanding something about how profile selection works?
Maven details:
% mvn --version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T10:41:47-06:00)
Maven home: /usr/local/Cellar/maven/3.3.9/libexec
Java version: 1.7.0_75, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.11.5", arch: "x86_64", family: "mac"