You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Osipov (Jira)" <ji...@apache.org> on 2021/01/23 21:58:00 UTC

[jira] [Comment Edited] (MNG-7074) Environment Variable defaulting

    [ https://issues.apache.org/jira/browse/MNG-7074?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17270770#comment-17270770 ] 

Michael Osipov edited comment on MNG-7074 at 1/23/21, 9:57 PM:
---------------------------------------------------------------

I think this can be abstracted by introducing a wellknown syntax from shell: {{${var:-default\\}}}.


was (Author: michael-o):
I think this can be abstracted by introducing a wellknown syntax from shell: {{${var:-default\}}}.

> Environment Variable defaulting
> -------------------------------
>
>                 Key: MNG-7074
>                 URL: https://issues.apache.org/jira/browse/MNG-7074
>             Project: Maven
>          Issue Type: New Feature
>            Reporter: Loïc Hermann
>            Priority: Major
>             Fix For: waiting-for-feedback
>
>
> Hi all,
> maven build in CI environment often rely on environnement variables.
> If those environment variables are not defined on the developper environment the build will fail.
> {{For now defaulting those environment variable can only be done by defining one profile per variable which is really verbose.}}
> {{it would be easier if we can either}}
> {{add a default value where the variable is used:}}
> ```
> {{$\{env.VARIABLE_NAME:defaultValue}}}
> ```
> or have a section to define default values in the pom:
> ```
> <environment>
>    <{{VARIABLE_NAME}}>defaultValue</{{VARIABLE_NAME}}>
> <environment/>
> ```
> I would love to work on a PR to implements one of those solution if this make sense to you.
>  
> Regards



--
This message was sent by Atlassian Jira
(v8.3.4#803005)