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

Slawomir Jaranowski commented on MNG-8087:
------------------------------------------

For changing *system properties* you should use:
{code:java}
MAVEN_OPTS="-Duser.home=/tmp/foo" mvn help:system -Duser.home=/tmp/foo | grep 
user.home
{code}
Maven should not change *system properties* such some of them can be read-only: 
[https://bugs.openjdk.org/browse/JDK-8204235]

When you execute
{code:java}
mvn  ... -Dfoo=test
{code}
you set *user properties* - not *system properties*

> `user.home` system property is not propagated
> ---------------------------------------------
>
>                 Key: MNG-8087
>                 URL: https://issues.apache.org/jira/browse/MNG-8087
>             Project: Maven
>          Issue Type: Bug
>    Affects Versions: 4.0.0-alpha-13
>            Reporter: Alexis Tual
>            Priority: Major
>
> When overriding {{user.home }} system property on a Maven build, the new 
> value is not seen by the Maven build. It's probably the same for other system 
> properties.
> While we discovered the bug in a custom extension, it's easy to reproduce on 
> any Maven build:
> - With Maven 3.9.x
> {code:bash}
> > mvn help:system -Duser.home=/tmp/foo | grep user.home
> user.home=/tmp/foo
> {code}
> - With Maven 4.0.0-alpha-13
> {code:bash}
> > mvn help:system -Duser.home=/tmp/foo | grep user.home
> user.home=/Users/me
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to