I am using Maven to build some projects and it's using the gMaven plugin to build an RPM that includes the main artifact. I only want Maven to attempt to build the RPM on systems that have rpmbuild, and not on systems that do not, so I built two separate profiles, one that is supposed to be default and one that is supposed to activate when on a Unix family OS.
I could have sworn that I tested it and everything worked correctly, but now it is running the Unix-family profile even when I build on OSX. However, if I change the profile's OS family to "windows" it definitely knows it is not on a Windows machine and therefore runs the default profile.
Here is the relevant section of my pom.xml file:
<profiles>
<profile>
<id>default-profile</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<rpmPhase>none</rpmPhase>
</properties>
</profile>
<profile>
<id>rpm-profile</id>
<activation>
<os>
<family>unix</family>
</os>
</activation>
<properties>
<rpmPhase>package</rpmPhase>
</properties>
</profile>
</profiles>
In the Maven output:
OS name: "mac os x", version: "10.9.4", arch: "x86_64", family: "mac"
However, Maven is setting rpmPhase to "package," instead of "none," which is not the expected behavior.
Can anyone see if I'm missing something here?
EDIT:
Also, if I set the OS family to something that doesn't exist, or if I comment out the activation block altogether then the default profile is used, so it seems that Maven is actively matching my OSX with a Unix family OS.