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

Support expression language in ${...}

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 3.0.4
    • None
    • General
    • None

    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

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

              Dates

                Created:
                Updated:
                Resolved: