You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/05/05 22:16:00 UTC

[jira] [Commented] (MNG-6296) New option -Dstyle.color is not working

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

ASF GitHub Bot commented on MNG-6296:
-------------------------------------

clambertus closed pull request #135: [MNG-6296] Parse properties before configuring the logging settings
URL: https://github.com/apache/maven/pull/135
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
index 3474fabbd5..977f174934 100644
--- a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
+++ b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
@@ -277,9 +277,9 @@ public int doMain( CliRequest cliRequest )
         {
             initialize( cliRequest );
             cli( cliRequest );
+            properties( cliRequest );
             logging( cliRequest );
             version( cliRequest );
-            properties( cliRequest );
             localContainer = container( cliRequest );
             commands( cliRequest );
             configure( cliRequest );


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> New option -Dstyle.color is not working
> ---------------------------------------
>
>                 Key: MNG-6296
>                 URL: https://issues.apache.org/jira/browse/MNG-6296
>             Project: Maven
>          Issue Type: Bug
>    Affects Versions: 3.5.2
>            Reporter: Robin Müller
>            Assignee: Robert Scholte
>            Priority: Major
>             Fix For: 3.5.3
>
>
> The new option {{-Dstyle.color=(auto|always|never)}} is not working. This happens as the corresponding code accesses the {{UserProperties}} of the {{CliRequest}} before they are set. I'll provide a quick fix for this by changing the order of the methods in the {{doMain}} method so the properties will be set at the right time.
> But I'd suggest to refactor the whole stuff so the code will become easier to understand and maintain. IMHO the functionality of the {{properties}} method in the {{MavenCli}} should be moved to the constructor of the {{CliRequest}}. The {{CliRequest}} itself should be immutable so all fields will have the correct content all the time.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)