maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Barrie Treloar <baerr...@gmail.com>
Subject Re: Maven Enforcer Plugin
Date Wed, 04 Nov 2009 04:37:46 GMT
On Wed, Nov 4, 2009 at 1:00 PM, Patel, Ronak Avinash (US SSA)
<ronak.patel@baesystems.com> wrote:
> Hi All,
>
> I have a Maven Multimodule project where one of my modules is using the Maven Enforcer
plugin to ensure that my module build is only successfully run on Unix.

[del]

> Obviously when I execute the Maven build on Windows, I see a warning that I am not on
Unix and then Maven proceeds to build the project anyway.
>
> My question is: is there any way to get Maven to failFast on the warning and skip building
this particular Maven Module?

I'm not sure that enforcer is the correct approach.  With Maven you
can't take away something once it is added.
An alternative is to use a profile, that way maven doesn't even
attempt to build your module on non-conforming systems.

In your parent project add something like:

  <profiles>
    <profile>
      <id>run-only-on-linux</id>
      <activation>
        <os>
          <name>linux</name>
          <family>unix</family>
        </os>
      </activation>
      <modules>
        <module>YOUR_MODULE_NAME_HERE</module>
      </modules>
    </profile>
  </profiles>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message