You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Hüseyin Kartal (Jira)" <ji...@apache.org> on 2021/12/13 01:33:00 UTC

[jira] [Commented] (MENFORCER-399) requireVariable = requireProperty or requireEnvironmentVariable

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

Hüseyin Kartal commented on MENFORCER-399:
------------------------------------------

I created a pom for demo.

You can define an environment variable and/or pass a property to that and the value will be used for the property "variable".  
{quote}{{<variable>${VAR}</variable>}}
{quote}
But it's not possible to enforce this behaviour. That ${VAR} is set.

 

 

To test just define envioronment like:
{quote}export VAR=environment
{quote}
 

Or pass the property like:
{quote}{{mvn install -DVAR=property}}
{quote}
 

> requireVariable = requireProperty or requireEnvironmentVariable
> ---------------------------------------------------------------
>
>                 Key: MENFORCER-399
>                 URL: https://issues.apache.org/jira/browse/MENFORCER-399
>             Project: Maven Enforcer Plugin
>          Issue Type: Improvement
>          Components: Standard Rules
>    Affects Versions: 3.0.0
>            Reporter: Hüseyin Kartal
>            Priority: Major
>         Attachments: pom.xml
>
>
> As far a i know maven doesn't care where a value for ${variable} comes from. In a pom you can access a env.variable or a property by ${variable}.
> Also in some system the value is provided by an environment variable like CICD or by a property maybe a dev environment.
> I would suggest a new standard rule "requireVariable"  which just look like maven for a value for this variable by property or environment.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)