Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-7426

Allow condition (like <activation>) on mojo executions

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Core
    • None

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            mickael.istria Mickael Istria
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: