You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Mickael Istria (Jira)" <ji...@apache.org> on 2022/02/28 09:44:00 UTC

[jira] [Created] (MNG-7426) Allow condition (like ) on mojo executions

Mickael Istria created MNG-7426:
-----------------------------------

             Summary: Allow condition (like <activation>) on mojo executions
                 Key: MNG-7426
                 URL: https://issues.apache.org/jira/browse/MNG-7426
             Project: Maven
          Issue Type: Improvement
          Components: Core
            Reporter: Mickael Istria


There are some goals that are only expected to run under some circumstances (eg a file exists, we're running on a particular OS...). The current solution to implement that is to create profiles and profiles are great particularly when multiple invocations or other configurations are involved as they allow to group things into a meaningful block; however in many cases, one can want to just decide to enable/disable 1 particular mojo execution. For those cases where only 1 execution is conditional, profiles seem like a lot of boilerplate and complexity.

Instead, we could imagine to add to `<execution>` element some `<activation>` (or whatever other meaningful name) child that would allow similar evaluations as what's possible with profile execution. When the activation condition is set and returns false, then the execution would be simply skipped.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)