Jerome Prinet created MNG-7829:
----------------------------------

             Summary: CLI properties passed with -D are not accessible with 
session.getSystemProperties()
                 Key: MNG-7829
                 URL: https://issues.apache.org/jira/browse/MNG-7829
             Project: Maven
          Issue Type: Bug
          Components: Command Line
    Affects Versions: 4.0.0-alpha-7
            Reporter: Jerome Prinet


h3. Context
 * Maven _4.0.0-alpha-6_ and above
 * A Maven extension collecting CLI arguments passed with _-D_

h3. Issue

In a Maven extension, I am collecting CLI arguments which allow to skip tests 
if present ({_}skipTests, skipITs, maven.test.skip{_}). 

The problem is that since Maven {_}4.0.0-alpha06{_}, these informations are not 
part of the 
[session.systemProperties|https://maven.apache.org/ref/3.9.3/maven-core/apidocs/org/apache/maven/execution/MavenSession.html#getSystemProperties()]
 anymore.

This is working fine until [this 
commit|https://github.com/apache/maven/commit/a1fa3eb5346f562a745f054650eee1e84c44db30?diff=unified]
 if not mistaken.

The missing instruction being [this 
one|https://github.com/apache/maven/commit/a1fa3eb5346f562a745f054650eee1e84c44db30?diff=unified#diff-b8b814f5b6b3855ae79dc45a0266b94871193dcef42803c316e07409e94af35cL1546].

*If I add this back on the latest version of master, I am able to collect the 
information.*
h3. Alternative

Those properties can be accessed via the 
[session.getUserProperties()|https://maven.apache.org/ref/3.9.3/maven-core/apidocs/org/apache/maven/execution/MavenSession.html#getUserProperties()]

Please confirm if this is the expected way to collect the data.{{{}{}}}



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

Reply via email to