[ 
https://jira.codehaus.org/browse/MNG-5347?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=334429#comment-334429
 ] 

Ondrej Zizka commented on MNG-5347:
-----------------------------------

+1 for Groovy, it's quite easy to integrate.

I absolutely disagree with these expressions being against descriptive 
approach. An expression is only evaluated to a value and has no side effect 
(should not have). It could have if Groovy is used, but maybe one can tell the 
engine to limit the accepted code to just an expression. Alternativelly, JUEL 
or similar EL lib may be used.

Mickael, are you about to try something in this direction? Here's how I used 
JUEL:
https://github.com/OndraZizka/jboss-migration/blob/master/src/main/java/org/jboss/loom/utils/el/JuelCustomResolverEvaluator.java
                
> Support expression language in ${...}
> -------------------------------------
>
>                 Key: MNG-5347
>                 URL: https://jira.codehaus.org/browse/MNG-5347
>             Project: Maven 2 & 3
>          Issue Type: Wish
>          Components: General
>    Affects Versions: 3.0.4
>         Environment: mistria@mistria--rh:~$ mvn -version
> Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
> Maven home: /home/mistria/apps/apache-maven-3.0.4
> Java version: 1.6.0_24, vendor: Sun Microsystems Inc.
> Java home: /usr/lib/jvm/java-6-openjdk-amd64/jre
> Default locale: en_US, platform encoding: UTF-8
> OS name: "linux", version: "3.2.0-30-generic", arch: "amd64", family: "unix"
>            Reporter: Mickael Istria
>
> Use-case:
> I want to give as input of my surefire-plugin
> {code}
> <configuration>
>     <skip>${skipTests} || ${skipDownloadRuntimes}</skip>
> <configuration>
> {code}
> 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 "$&#123;skipTests} || $&#123;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:
> {code}
> <configuration>
>     <skip>${skipTests|| skipDownloadRuntimes}</skip>
> <configuration>
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to