michael-o commented on a change in pull request #605:
URL: https://github.com/apache/maven/pull/605#discussion_r742038377



##########
File path: maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
##########
@@ -1731,15 +1730,19 @@ static void populateProperties( CommandLine 
commandLine, Properties systemProper
         // are most dominant.
         // 
----------------------------------------------------------------------
 
-        Arrays.stream( commandLine.getOptions() )
-                .filter( option -> CLIManager.SET_SYSTEM_PROPERTY == 
option.getOpt().charAt( 0 ) )
-                .map( option -> option.getValues() )
-                .forEach( values ->
-                {
-                    final String key = values[0].trim();
-                    final String value = values.length == 2 ? values[1] : 
"true";
-                    setCliProperty( key, value, userProperties );
-                } );
+        for ( final Option option : commandLine.getOptions() )
+        {
+            final String opt = option.getOpt();
+            // Some options do not have a "short" version (e.g. color, debug).
+            // We are specifically looking for the "-D" option.
+            if ( opt != null && CLIManager.SET_SYSTEM_PROPERTY == opt.charAt( 
0 ) )

Review comment:
       Can the option be null action? What if the user has supplied `--define 
...`?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to