I use Maven to create some projects, and it uses the gMaven plugin to create an RPM that includes the main artifact. I want Maven to try to create RPMs on systems with rpmbuild, and not on systems that don't, so I built two separate profiles, one of which should be the default, and one that should be activated when in the Unix OS family .
I could swear that I tested it and everything works correctly, but now it works with the profile of the Unix family, even when I create OSX. However, if I change the OS family of the profile to βwindows,β he definitely knows that this is not on the Windows machine, and therefore launches 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 output of Maven:
OS name: "mac os x", version: "10.9.4", arch: "x86_64", family: "mac"
However, Maven sets rpmPhase to "package" instead of "none", which is not the expected behavior.
Can someone see if there is anything here?
EDIT:
In addition, if I install the OS family on something that does not exist, or if I comment on the activation block at all, then the default profile is used, so it seems that Maven is actively matching my OSX with the Unix OS family.