[
https://issues.apache.org/jira/browse/MSHARED-971?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17277179#comment-17277179
]
Sylwester Lachiewicz commented on MSHARED-971:
----------------------------------------------
{code:java}
/**
* Indicates whether the environment variables of the current process should be
propagated to the Maven invocation.
* By default, the current environment variables are inherited by the new Maven
invocation.
*
* @return <code>true</code> if the environment variables should be propagated,
<code>false</code> otherwise.
*/
boolean isShellEnvironmentInherited();
{code}
so by default it should be inherited, but You have option to disable it if
needed
> System environment variable are always added to maven-invoker
> -------------------------------------------------------------
>
> Key: MSHARED-971
> URL: https://issues.apache.org/jira/browse/MSHARED-971
> Project: Maven Shared Components
> Issue Type: Bug
> Components: maven-invoker, maven-shared-utils
> Reporter: Slawomir Jaranowski
> Priority: Minor
>
> In {{org.apache.maven.shared.invoker.MavenCommandLineBuilder}}
> [https://github.com/apache/maven-invoker/blob/d58703dd592ba0bc6f0a09928d0cce90e4002af9/src/main/java/org/apache/maven/shared/invoker/MavenCommandLineBuilder.java#L197-L242]
> we have code:
> {code}
> if ( request.isShellEnvironmentInherited() )
> {
> cli.addSystemEnvironment();
> }
> {code}
> but in {{org.apache.maven.shared.utils.cli.Commandline}} we have:
> {code}
> public String[] getEnvironmentVariables()
> {
> addSystemEnvironment();
> ...
> }
> {code}
> System environment variable are always added - it is inconsistent
> implementation.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)