[GitHub] maven pull request #153: [MNG-6069] Migrate to non deprecated parts of Commo...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] maven pull request #153: [MNG-6069] Migrate to non deprecated parts of Commo...

clarkperkins
Github user slachiewicz commented on a diff in the pull request:

    https://github.com/apache/maven/pull/153#discussion_r167400525
 
    --- Diff: maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java ---
    @@ -1620,14 +1620,18 @@ static void populateProperties( CommandLine commandLine, Properties systemProper
     
             if ( commandLine.hasOption( CLIManager.SET_SYSTEM_PROPERTY ) )
             {
    -            String[] defStrs = commandLine.getOptionValues( CLIManager.SET_SYSTEM_PROPERTY );
    -            
    -            if ( defStrs != null )
    +            Properties lineOptionProperties = commandLine.getOptionProperties( CLIManager.SET_SYSTEM_PROPERTY );
    +
    +            for ( String defStr : lineOptionProperties.stringPropertyNames( ) )
                 {
    -                for ( String defStr : defStrs )
    -                {
    -                    setCliProperty( defStr, userProperties );
    -                }
    +                String optValue = lineOptionProperties.getProperty( defStr );
    +                userProperties.setProperty( defStr, optValue );
    +
    +                // ----------------------------------------------------------------------
    +                // I'm leaving the setting of system properties here as not to break
    +                // the SystemPropertyProfileActivator. This won't harm embedding. jvz.
    +                // ----------------------------------------------------------------------
    +               System.setProperty( defStr, optValue );
    --- End diff --
   
    System properties will stay, new commons-cli just simplified setCliProperty.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]