Maven profile activation with multiple conditions

I'm working on getting the rpm-maven plugin setup in a project. In our staging and production environments, the build occurs on Red Hat boxes, but we have several Windows boxes that are used for development and testing so I wanted the RPM build process to be part of a profile that is only active on a box that has rpmbuild installed.

This was my first attempt at an activation condition:

<activation>
  <os>
    <family>unix</family>
  </os> 
  <file>
    <exists>/usr/bin/rpmbuild</exists>
  </file>
</activation>

My initial testing only involved building on a Windows box and building on a CentOS box, and both gave me the results I expected. Later, the build broke on a Linux machine that didn't have rpmbuild available. It looks like having two conditions like this isn't supported. Is this the case? I realize I can probably just get rid of the element and get the results I want, but for future reference is there a better way to create profiles with multiple activation conditions?

40
задан bhinks 7 January 2011 в 18:53
поделиться