maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject maven git commit: [MNG-3507] enhanced error hints with color
Date Sun, 12 Jun 2016 17:30:51 GMT
Repository: maven
Updated Branches:
  refs/heads/master 050936ce1 -> 92334a1dd


[MNG-3507] enhanced error hints with color

Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/92334a1d
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/92334a1d
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/92334a1d

Branch: refs/heads/master
Commit: 92334a1dd9f2f3df77b3c039be7742ea19a8ee81
Parents: 050936c
Author: Hervé Boutemy <hboutemy@apache.org>
Authored: Sun Jun 12 19:30:48 2016 +0200
Committer: Hervé Boutemy <hboutemy@apache.org>
Committed: Sun Jun 12 19:30:48 2016 +0200

----------------------------------------------------------------------
 .../src/main/java/org/apache/maven/cli/MavenCli.java   | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/92334a1d/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
----------------------------------------------------------------------
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 15dc575..38caf83 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
@@ -19,6 +19,8 @@ package org.apache.maven.cli;
  * under the License.
  */
 
+import static org.fusesource.jansi.Ansi.ansi;
+
 import java.io.BufferedInputStream;
 import java.io.Console;
 import java.io.File;
@@ -1011,11 +1013,13 @@ public class MavenCli
 
             if ( !cliRequest.showErrors )
             {
-                slf4jLogger.error( "To see the full stack trace of the errors, re-run Maven
with the -e switch." );
+                slf4jLogger.error( "To see the full stack trace of the errors, re-run Maven
with the "
+                    + ansi().bold().a( "-e" ).reset() + " switch." );
             }
             if ( !slf4jLogger.isDebugEnabled() )
             {
-                slf4jLogger.error( "Re-run Maven using the -X switch to enable full debug
logging." );
+                slf4jLogger.error( "Re-run Maven using the " + ansi().bold().a( "-X" ).reset()
+                    + " switch to enable full debug logging." );
             }
 
             if ( !references.isEmpty() )
@@ -1026,7 +1030,7 @@ public class MavenCli
 
                 for ( Map.Entry<String, String> entry : references.entrySet() )
                 {
-                    slf4jLogger.error( entry.getValue() + " " + entry.getKey() );
+                    slf4jLogger.error( ansi().bold().a( entry.getValue() ).reset() + " "
+ entry.getKey() );
                 }
             }
 
@@ -1034,7 +1038,8 @@ public class MavenCli
             {
                 slf4jLogger.error( "" );
                 slf4jLogger.error( "After correcting the problems, you can resume the build
with the command" );
-                slf4jLogger.error( "  mvn <goals> -rf :" + project.getArtifactId()
);
+                slf4jLogger.error( ansi().bold().a( "  mvn <goals> -rf :" )
+                                   .a( project.getArtifactId() ).reset().toString() );
             }
 
             if ( MavenExecutionRequest.REACTOR_FAIL_NEVER.equals( cliRequest.request.getReactorFailureBehavior()
) )


Mime
View raw message