Andy Feldman wrote:
>> My situation is unfortunately a bit more complex than that, as I have
>> *two* <execution>s of the maven-enforcer-plugin, only one of which
>> should be affected by -DskipChecks. The other simply uses the
>> <requireMavenVersion> rule, which IMHO shouldn't easily be disabled (but
>> should still respect -Denforcer.skip)
>> [...]
>> What I want is this:
>> [...]
> 
> -Denforcer.skip, being the more direct option, should
>> take precedence over -DskipChecks.
> 
> Just an idea:
> 
> <properties>
>   <enforcer.skip>false</enforcer.skip>
>   <skipChecks>${enforcer.skip}</skipChecks>
> </properties>
> 
> This way if you set -DskipChecks=true, then only <id>checks</id> would be
> skipped, but if you set -Denforcer.skip=true, it would also cause
> skipChecks to be true, so both executions would be skipped. I haven't
> actually tested it though.

Thanks, Andy. The above does have the desired behavior *if* the
maven-enforcer-plugin were the only plugin which should be governed by
-DskipChecks.

But as I said in my initial mail, that property should also control the
maven-checkstyle-plugin, maven-tidy-plugin, and others (kine of like
-DskipTests does for maven-surefire-plugin and maven-failsafe-plugin).
And that's just not doable with

  <skipChecks>${enforcer.skip}</skipChecks>

I experimented quite a bit yesterday and have become convinced that the
desired behavior is not possible, at least without profiles (ugh!) --
and even then I am not sure, as the profile would need to affect only
some executions.

But maybe I am missing something.

Best wishes,

Andreas

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to