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

Support expression language in ${...}

    XMLWordPrintableJSON

    Details

    • Type: Wish
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 3.0.4
    • Fix Version/s: None
    • Component/s: General
    • Labels:
      None
    • Environment:

      Description

      Use-case:
      I want to give as input of my surefire-plugin

      <configuration>
          <skip>${skipTests} || ${skipDownloadRuntimes}</skip>
      <configuration>
      

      This won't work because the expressions are not evaluated. Boolean arguments in plugin are set to something like Boolean.parseBoolean, which is quite limited.

      Instead, we could think of introducing an expression language, such as Groovy, that would allow expressions as parameters for plugins.
      Then let's say skipTests=false and skipDownloadRuntimes=true, Maven would first replace "${skipTests} || ${skipDownloadRuntimes}" by "false || true" and then this evaluator would evaluate that to "false", and skip will receive the value "false".

      This would for sure make maven less verbose in some cases.

      EDIT (thanks Ondrej for inspiring commnent)
      Actually, this syntax would make more sense, and allow an expression language:

      <configuration>
          <skip>${skipTests|| skipDownloadRuntimes}</skip>
      <configuration>
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                mickael.istria Mickael Istria
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: