[
https://issues.apache.org/jira/browse/MNG-7782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17722393#comment-17722393
]
Michael Osipov commented on MNG-7782:
-------------------------------------
You can consider it as a bug or a misconception because those are different set
of properties. Hopefully, we can remove this promotion when all components have
been corrected. Yet another issue is that not all system properties can be
overriden after the JVM has been started. This can cause issues, not visible,
see also: MNG-7556.
> System properties are no longer overridden with user properties with the same
> name
> ----------------------------------------------------------------------------------
>
> Key: MNG-7782
> URL: https://issues.apache.org/jira/browse/MNG-7782
> Project: Maven
> Issue Type: Bug
> Components: Core
> Affects Versions: 4.0.0-alpha-6, 4.0.x-candidate
> Environment: windows, linux, macos
> Reporter: Alexey Venderov
> Priority: Minor
>
> Hi!
> I've noticed the regression in the latest Maven 4.0-SNAPSHOT. System
> properties are no longer overridden with user properties with the same name.
> In Maven 3.9.2 and earlier properties set via the command line
> ({_}-Duser.name=test{_}) where overriding system properties with the same
> name:
> {code:java}
> 🕙 15:01:32 ➜ mvn --version
> Apache Maven 3.9.2 (c9616018c7a021c1c39be70fb2843d6f5f9b8a1c)
> Maven home: /Users/avenderov/.sdkman/candidates/maven/current
> Java version: 11.0.19, vendor: Azul Systems, Inc., runtime:
> /Users/avenderov/.asdf/installs/java/zulu-11.64.19/zulu-11.jdk/Contents/Home
> Default locale: en_DE, platform encoding: UTF-8
> OS name: "mac os x", version: "12.6.5", arch: "aarch64", family: "mac"
> tmp/maven/dist/apache-maven-4.0.0-SNAPSHOT/bin 563ms
> 🕙 15:01:57 ➜ mvn -Duser.name=test help:system | grep user.name
> sun.java.command=org.codehaus.plexus.classworlds.launcher.Launcher
> -Duser.name=test help:system
> user.name=test
> MAVEN_CMD_LINE_ARGS= -Duser.name=test help:system
> {code}
> Â
> In Maven 4.0.0-SNAPSHOT the behavior is different:
> {code:java}
> 🕙 15:08:23 ➜ ./mvn --version
> Unable to find the root directory. Create a .mvn directory in the root
> directory or add the root="true" attribute on the root project's model to
> identify it.
> Apache Maven 4.0.0-alpha-6-SNAPSHOT (a56f20199184d167326dd17650c731b4e490abd1)
> Maven home: /Users/avenderov/tmp/maven/dist/apache-maven-4.0.0-SNAPSHOT
> Java version: 11.0.19, vendor: Azul Systems, Inc., runtime:
> /Users/avenderov/.asdf/installs/java/zulu-11.64.19/zulu-11.jdk/Contents/Home
> Default locale: en_DE, platform encoding: UTF-8
> OS name: "mac os x", version: "12.6.5", arch: "aarch64", family: "mac"
> tmp/maven/dist/apache-maven-4.0.0-SNAPSHOT/bin 573ms
> 🕙 15:08:40 ➜ ./mvn -Duser.name=test help:system | grep user.name
> Unable to find the root directory. Create a .mvn directory in the root
> directory or add the root="true" attribute on the root project's model to
> identify it.
> sun.java.command=org.codehaus.plexus.classworlds.launcher.Launcher
> -Duser.name=test help:system
> user.name=avenderov
> {code}
> Â
--
This message was sent by Atlassian Jira
(v8.20.10#820010)