HI Scott,
You can make a conditional profile keyed on a java property. For example, I
have a profile that looks like this:
<!-- add tools.jar to path when on Linux or Windows -->
<profile>
<id>tools.jar</id>
<activation>
<property>
<name>java.vendor</name>
<value>Sun Microsystems Inc.</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.6.0</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</profile>
The <activation> tag says that this profile should automatically be enabled
when the property "java.vendor" has the value "Sun Microsystems Inc." - this
happens on the standard Sun releases on Windows and Linux. The <build> tag
describes what should happen when the profile is active. In this case, it adds
a dependency to the maven-antrun-plugin that is defined elsewhere in the pom.
Regards,
Russ
On Jul 20, 2012, at 6:10 PM, Scott Klein wrote:
> Hi,
>
> I have the maven rpm plugin working great (tied to the package goal). However
> not everyone on the team is developing on RedHat/CentOS (and therefore
> don=92t have rpm-build installed).
>
> How can I prevent the plugin from executing when not on RedHat/CentOS?
>
> Thanks,
>
> Scott.
>
-----------------
Come read my webnovel, Take a Lemon <http://www.takealemon.com>,
and listen to the Misfile radio play
<http://www.gold-family.us/audio/misfile.html>!