You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sc...@apache.org on 2016/06/19 23:15:05 UTC

[2/5] maven git commit: [MNG-3507] use AnsiUtils API to use colors consistently

[MNG-3507] use AnsiUtils API to use colors consistently

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

Branch: refs/heads/MNG-6006
Commit: 402ce4c3cd1e970d2d4186aa6fc3e10c612241fb
Parents: 162c740
Author: Herv� Boutemy <hb...@apache.org>
Authored: Mon Jun 20 00:35:17 2016 +0200
Committer: Herv� Boutemy <hb...@apache.org>
Committed: Mon Jun 20 00:35:41 2016 +0200

----------------------------------------------------------------------
 maven-core/pom.xml                              | 10 +++-
 .../lifecycle/LifecycleExecutionException.java  | 19 ++++----
 maven-embedder/pom.xml                          |  4 +-
 .../org/apache/maven/cli/CLIReportingUtils.java |  4 +-
 .../java/org/apache/maven/cli/MavenCli.java     | 21 ++++----
 .../maven/cli/event/ExecutionEventLogger.java   | 50 ++++++++++----------
 .../cli/logging/impl/gossip/ColorRenderer.java  | 26 +++++-----
 pom.xml                                         |  6 +--
 8 files changed, 72 insertions(+), 68 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/402ce4c3/maven-core/pom.xml
----------------------------------------------------------------------
diff --git a/maven-core/pom.xml b/maven-core/pom.xml
index cc648be..f03eead 100644
--- a/maven-core/pom.xml
+++ b/maven-core/pom.xml
@@ -85,8 +85,14 @@ under the License.
       <artifactId>aether-util</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.fusesource.jansi</groupId>
-      <artifactId>jansi</artifactId>
+      <groupId>org.apache.maven.shared</groupId>
+      <artifactId>maven-project-utils</artifactId>
+      <exclusions>
+        <exclusion>
+          <groupId>org.apache.maven</groupId>
+          <artifactId>maven-core</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>
     <!-- Plexus -->
     <dependency>

http://git-wip-us.apache.org/repos/asf/maven/blob/402ce4c3/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleExecutionException.java
----------------------------------------------------------------------
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleExecutionException.java b/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleExecutionException.java
index fd4bca0..5645abd 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleExecutionException.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleExecutionException.java
@@ -19,11 +19,11 @@ package org.apache.maven.lifecycle;
  * under the License.
  */
 
-import static org.fusesource.jansi.Ansi.ansi;
+import static org.apache.maven.shared.project.utils.AnsiUtils.ansi;
 
 import org.apache.maven.plugin.MojoExecution;
 import org.apache.maven.project.MavenProject;
-import org.fusesource.jansi.Ansi;
+import org.apache.maven.shared.project.utils.AnsiUtils;
 
 /**
  * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
@@ -78,26 +78,27 @@ public class LifecycleExecutionException
 
     private static String createMessage( MojoExecution execution, MavenProject project, Throwable cause )
     {
-        Ansi buffer = ansi( /*256*/ );
+        AnsiUtils buffer = ansi( 256 );
 
-        buffer.a( "Failed to execute goal" ).reset();
+        buffer.a( "Failed to execute goal" );
 
         if ( execution != null )
         {
-            buffer.a( ' ' ).a( execution.getGroupId() ).a( ':' ).fgGreen().a( execution.getArtifactId() );
-            buffer.a( ':' ).a( execution.getVersion() ).a( ':' ).a( execution.getGoal() ).reset();
-            buffer.bold().a( " (" ).a( execution.getExecutionId() ).a( ')' ).reset();
+            buffer.a( ' ' ).a( execution.getGroupId() ).a( ':' );
+            buffer.mojo().a( execution.getArtifactId() ).a( ':' );
+            buffer.a( execution.getVersion() ).a( ':' ).a( execution.getGoal() ).reset();
+            buffer.strong().a( " (" ).a( execution.getExecutionId() ).a( ')' ).reset();
         }
 
         if ( project != null )
         {
             buffer.a( " on project " );
-            buffer.fgCyan().a( project.getArtifactId() ).reset();
+            buffer.project( project.getArtifactId() );
         }
 
         if ( cause != null )
         {
-            buffer.a( ": " ).bold().fgRed().a( cause.getMessage() ).reset();
+            buffer.a( ": " ).failure( cause.getMessage() );
         }
 
         return buffer.toString();

http://git-wip-us.apache.org/repos/asf/maven/blob/402ce4c3/maven-embedder/pom.xml
----------------------------------------------------------------------
diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml
index eb72f93..7e4032f 100644
--- a/maven-embedder/pom.xml
+++ b/maven-embedder/pom.xml
@@ -80,8 +80,8 @@ under the License.
       <artifactId>plexus-cipher</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.fusesource.jansi</groupId>
-      <artifactId>jansi</artifactId>
+      <groupId>org.apache.maven.shared</groupId>
+      <artifactId>maven-project-utils</artifactId>
     </dependency>
     <dependency>
       <groupId>org.slf4j</groupId>

http://git-wip-us.apache.org/repos/asf/maven/blob/402ce4c3/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java
----------------------------------------------------------------------
diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java b/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java
index 18e43ef..aa28b27 100644
--- a/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java
+++ b/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java
@@ -19,7 +19,7 @@ package org.apache.maven.cli;
  * under the License.
  */
 
-import static org.fusesource.jansi.Ansi.ansi;
+import static org.apache.maven.shared.project.utils.AnsiUtils.ansi;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -57,7 +57,7 @@ public final class CLIReportingUtils
         final String ls = System.getProperty( "line.separator" );
         Properties properties = getBuildProperties();
         StringBuilder version = new StringBuilder( 256 );
-        version.append( ansi().bold().a( createMavenVersionString( properties ) ).reset() ).append( ls );
+        version.append( ansi().strong( createMavenVersionString( properties ) ) ).append( ls );
         version.append( reduce(
             properties.getProperty( "distributionShortName" ) + " home: " + System.getProperty( "maven.home",
                                                                                                 "<unknown Maven "

http://git-wip-us.apache.org/repos/asf/maven/blob/402ce4c3/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 b07fdc9..fd0a81a 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,7 +19,7 @@ package org.apache.maven.cli;
  * under the License.
  */
 
-import static org.fusesource.jansi.Ansi.ansi;
+import static org.apache.maven.shared.project.utils.AnsiUtils.ansi;
 
 import java.io.BufferedInputStream;
 import java.io.Console;
@@ -91,6 +91,7 @@ import org.apache.maven.model.profile.ProfileSelector;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.properties.internal.EnvironmentUtils;
 import org.apache.maven.properties.internal.SystemProperties;
+import org.apache.maven.shared.project.utils.AnsiUtils;
 import org.apache.maven.toolchain.building.DefaultToolchainsBuildingRequest;
 import org.apache.maven.toolchain.building.ToolchainsBuilder;
 import org.apache.maven.toolchain.building.ToolchainsBuildingResult;
@@ -110,8 +111,6 @@ import com.google.common.base.Charsets;
 import com.google.common.io.Files;
 import com.google.inject.AbstractModule;
 import org.eclipse.aether.transfer.TransferListener;
-import org.fusesource.jansi.Ansi;
-import org.fusesource.jansi.AnsiConsole;
 import org.slf4j.ILoggerFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -212,9 +211,9 @@ public class MavenCli
     {
         MavenCli cli = new MavenCli();
 
-        AnsiConsole.systemInstall();
+        AnsiUtils.systemInstall();
         int result = cli.doMain( new CliRequest( args, classWorld ) );
-        AnsiConsole.systemUninstall();
+        AnsiUtils.systemUninstall();
 
         return result;
     }
@@ -476,7 +475,7 @@ public class MavenCli
 
         if ( cliRequest.commandLine.hasOption( CLIManager.BATCH_MODE ) )
         {
-            Ansi.setEnabled( false );
+            AnsiUtils.setEnabled( false );
         }
 
         if ( cliRequest.commandLine.hasOption( CLIManager.LOG_FILE ) )
@@ -484,7 +483,7 @@ public class MavenCli
             File logFile = new File( cliRequest.commandLine.getOptionValue( CLIManager.LOG_FILE ) );
             logFile = resolveFile( logFile, cliRequest.workingDirectory );
 
-            Ansi.setEnabled( false );
+            AnsiUtils.setEnabled( false );
 
             // redirect stdout and stderr to file
             try
@@ -1021,11 +1020,11 @@ public class MavenCli
             if ( !cliRequest.showErrors )
             {
                 slf4jLogger.error( "To see the full stack trace of the errors, re-run Maven with the "
-                    + ansi().bold().a( "-e" ).reset() + " switch." );
+                    + ansi().strong( "-e" ) + " switch." );
             }
             if ( !slf4jLogger.isDebugEnabled() )
             {
-                slf4jLogger.error( "Re-run Maven using the " + ansi().bold().a( "-X" ).reset()
+                slf4jLogger.error( "Re-run Maven using the " + ansi().strong( "-X" )
                     + " switch to enable full debug logging." );
             }
 
@@ -1037,7 +1036,7 @@ public class MavenCli
 
                 for ( Map.Entry<String, String> entry : references.entrySet() )
                 {
-                    slf4jLogger.error( ansi().bold().a( entry.getValue() ).reset() + " " + entry.getKey() );
+                    slf4jLogger.error( ansi().strong( entry.getValue() ) + " " + entry.getKey() );
                 }
             }
 
@@ -1045,7 +1044,7 @@ public class MavenCli
             {
                 slf4jLogger.error( "" );
                 slf4jLogger.error( "After correcting the problems, you can resume the build with the command" );
-                slf4jLogger.error( ansi().bold().a( "  mvn <goals> -rf :" )
+                slf4jLogger.error( ansi().strong().a( "  mvn <goals> -rf :" )
                                    .a( project.getArtifactId() ).reset().toString() );
             }
 

http://git-wip-us.apache.org/repos/asf/maven/blob/402ce4c3/maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java
----------------------------------------------------------------------
diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java b/maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java
index ee57121..9b3bad4 100644
--- a/maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java
+++ b/maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java
@@ -21,7 +21,7 @@ package org.apache.maven.cli.event;
 
 import static org.apache.maven.cli.CLIReportingUtils.formatDuration;
 import static org.apache.maven.cli.CLIReportingUtils.formatTimestamp;
-import static org.fusesource.jansi.Ansi.ansi;
+import static org.apache.maven.shared.project.utils.AnsiUtils.ansi;
 
 import org.apache.commons.lang3.Validate;
 import org.apache.maven.execution.AbstractExecutionListener;
@@ -34,8 +34,8 @@ import org.apache.maven.execution.MavenSession;
 import org.apache.maven.plugin.MojoExecution;
 import org.apache.maven.plugin.descriptor.MojoDescriptor;
 import org.apache.maven.project.MavenProject;
+import org.apache.maven.shared.project.utils.AnsiUtils;
 import org.codehaus.plexus.util.StringUtils;
-import org.fusesource.jansi.Ansi;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -83,7 +83,7 @@ public class ExecutionEventLogger
 
     private void infoMain( String msg )
     {
-        logger.info( ansi().bold().a( msg ).reset().toString() );
+        logger.info( ansi().strong( msg ).toString() );
     }
 
     @Override
@@ -161,11 +161,11 @@ public class ExecutionEventLogger
 
             if ( buildSummary == null )
             {
-                buffer.append( ansi().bold().fgYellow().a( "SKIPPED" ).reset() );
+                buffer.append( ansi().warning( "SKIPPED" ) );
             }
             else if ( buildSummary instanceof BuildSuccess )
             {
-                buffer.append( ansi().bold().fgGreen().a( "SUCCESS" ).reset() );
+                buffer.append( ansi().success( "SUCCESS" ) );
                 buffer.append( " [" );
                 String buildTimeDuration = formatDuration( buildSummary.getTime() );
                 int padSize = MAX_PADDED_BUILD_TIME_DURATION_LENGTH - buildTimeDuration.length();
@@ -178,7 +178,7 @@ public class ExecutionEventLogger
             }
             else if ( buildSummary instanceof BuildFailure )
             {
-                buffer.append( ansi().bold().fgRed().a( "FAILURE" ).reset() );
+                buffer.append( ansi().failure( "FAILURE" ) );
                 buffer.append( " [" );
                 String buildTimeDuration = formatDuration( buildSummary.getTime() );
                 int padSize = MAX_PADDED_BUILD_TIME_DURATION_LENGTH - buildTimeDuration.length();
@@ -197,17 +197,17 @@ public class ExecutionEventLogger
     private void logResult( MavenSession session )
     {
         infoLine( '-' );
-        Ansi ansi = ansi().bold();
+        AnsiUtils ansi = ansi();
 
         if ( session.getResult().hasExceptions() )
         {
-            ansi.fgRed().a( "BUILD FAILURE" );
+            ansi.failure( "BUILD FAILURE" );
         }
         else
         {
-            ansi.fgGreen().a( "BUILD SUCCESS" );
+            ansi.success( "BUILD SUCCESS" );
         }
-        logger.info( ansi.reset().toString() );
+        logger.info( ansi.toString() );
     }
 
     private void logStats( MavenSession session )
@@ -282,10 +282,10 @@ public class ExecutionEventLogger
         {
             logger.info( "" );
 
-            Ansi ansi = ansi().bold().a( "--- " ).reset();
+            AnsiUtils ansi = ansi().strong( "--- " );
             append( ansi, event.getMojoExecution() );
             append( ansi, event.getProject() );
-            ansi.bold().a( " ---" ).reset();
+            ansi.strong( " ---" );
 
             logger.info( ansi.toString() );
         }
@@ -302,12 +302,12 @@ public class ExecutionEventLogger
         {
             logger.info( "" );
 
-            Ansi ansi = ansi().bold().a( ">>> " ).reset();
+            AnsiUtils ansi = ansi().strong( ">>> " );
             append( ansi, event.getMojoExecution() );
-            ansi.bold().a( " > " ).reset();
+            ansi.strong( " > " );
             appendForkInfo( ansi, event.getMojoExecution().getMojoDescriptor() );
             append( ansi, event.getProject() );
-            ansi.bold().a( " >>>" ).reset();
+            ansi.strong( " >>>" );
 
             logger.info( ansi.toString() );
         }
@@ -326,30 +326,30 @@ public class ExecutionEventLogger
         {
             logger.info( "" );
 
-            Ansi ansi = ansi().bold().a( "<<< " ).reset();
+            AnsiUtils ansi = ansi().strong( "<<< " );
             append( ansi, event.getMojoExecution() );
-            ansi.bold().a( " < " ).reset();
+            ansi.strong( " < " );
             appendForkInfo( ansi, event.getMojoExecution().getMojoDescriptor() );
             append( ansi, event.getProject() );
-            ansi.bold().a( " <<<" ).reset();
+            ansi.strong( " <<<" );
 
             logger.info( ansi.toString() );
         }
     }
 
-    private void append( Ansi ansi, MojoExecution me )
+    private void append( AnsiUtils ansi, MojoExecution me )
     {
-        ansi.fgGreen().a( me.getArtifactId() ).a( ':' ).a( me.getVersion() );
+        ansi.mojo().a( me.getArtifactId() ).a( ':' ).a( me.getVersion() );
         ansi.a( ':' ).a( me.getGoal() ).reset();
         if ( me.getExecutionId() != null )
         {
-            ansi.bold().a( " (" ).a( me.getExecutionId() ).a( ')' ).reset();
+            ansi.strong( " (" ).a( me.getExecutionId() ).a( ')' );
         }
     }
 
-    private void appendForkInfo( Ansi ansi, MojoDescriptor md )
+    private void appendForkInfo( AnsiUtils ansi, MojoDescriptor md )
     {
-        ansi.bold();
+        ansi.strong();
         if ( StringUtils.isNotEmpty( md.getExecutePhase() ) )
         {
             // forked phase
@@ -370,9 +370,9 @@ public class ExecutionEventLogger
         ansi.reset();
     }
 
-    private void append( Ansi ansi, MavenProject project )
+    private void append( AnsiUtils ansi, MavenProject project )
     {
-        ansi.a( " @ " ).fgCyan().a( project.getArtifactId() ).reset();
+        ansi.a( " @ " ).project( project.getArtifactId() );
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/maven/blob/402ce4c3/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/gossip/ColorRenderer.java
----------------------------------------------------------------------
diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/gossip/ColorRenderer.java b/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/gossip/ColorRenderer.java
index 52e0489..ba0c20a 100644
--- a/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/gossip/ColorRenderer.java
+++ b/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/gossip/ColorRenderer.java
@@ -19,7 +19,7 @@ package org.apache.maven.cli.logging.impl.gossip;
  * under the License.
  */
 
-import static org.fusesource.jansi.Ansi.ansi;
+import static org.apache.maven.shared.project.utils.AnsiUtils.ansi;
 
 import com.planet57.gossip.Event;
 import com.planet57.gossip.Level;
@@ -46,20 +46,20 @@ extends com.planet57.gossip.render.PatternRenderer
         {
             case TRACE:
             case DEBUG:
-                buff.append( ansi().bold().fgCyan().a( level.name() ).reset() );
+                buff.append( ansi().debug().a( level.name() ).reset() );
                 break;
 
             case INFO:
-                buff.append( ansi().bold().fgBlue().a( level.name() ).reset() );
+                buff.append( ansi().info().a( level.name() ).reset() );
                 break;
 
             case WARN:
                 // Maven uses WARNING instead of WARN
-                buff.append( ansi().bold().fgYellow().a( WARNING ).reset() );
+                buff.append( ansi().warning().a( WARNING ).reset() );
                 break;
 
             case ERROR:
-                buff.append( ansi().bold().fgRed().a( level.name() ).reset() );
+                buff.append( ansi().error().a( level.name() ).reset() );
                 break;
 
             default:
@@ -72,7 +72,7 @@ extends com.planet57.gossip.render.PatternRenderer
     {
         StringBuilder tmp = new StringBuilder();
         super.renderName( event, tmp, shortName );
-        buff.append( ansi().fgGreen().a( tmp ).reset() );
+        buff.append( ansi().success( tmp ) );
     }
 
 
@@ -88,11 +88,11 @@ extends com.planet57.gossip.render.PatternRenderer
             return;
         }
 
-        buff.append( ansi().bold().fgRed().a( cause.getClass().getName() ).reset() );
+        buff.append( ansi().failure( cause.getClass().getName() ) );
         if ( cause.getMessage() != null )
         {
             buff.append( ": " );
-            buff.append( ansi().bold().fgRed().a( cause.getMessage() ).reset() );
+            buff.append( ansi().failure( cause.getMessage() ) );
         }
         renderNewLine( buff );
 
@@ -101,21 +101,19 @@ extends com.planet57.gossip.render.PatternRenderer
             for ( StackTraceElement e : cause.getStackTrace() )
             {
                 buff.append( "    " );
-                buff.append( ansi().bold().a( "at" ).reset().a( " " )
-                        .a( e.getClassName() ).a( "." ).a( e.getMethodName() ) );
-                buff.append( ansi().a( " (" ).bold().a( getLocation( e ) ).reset().a( ")" ) );
+                buff.append( ansi().strong( "at" ).a( " " ).a( e.getClassName() ).a( "." ).a( e.getMethodName() ) );
+                buff.append( ansi().a( " (" ).strong( getLocation( e ) ).a( ")" ) );
                 renderNewLine( buff );
             }
 
             cause = cause.getCause();
             if ( cause != null )
             {
-                buff.append( ansi().bold().a( "Caused by" ).reset().a( ": " )
-                        .a( cause.getClass().getName() ) );
+                buff.append( ansi().strong( "Caused by" ).a( ": " ).a( cause.getClass().getName() ) );
                 if ( cause.getMessage() != null )
                 {
                     buff.append( ": " );
-                    buff.append( ansi().bold().fgRed().a( cause.getMessage() ).reset() );
+                    buff.append( ansi().failure( cause.getMessage() ) );
                 }
                 renderNewLine( buff );
             }

http://git-wip-us.apache.org/repos/asf/maven/blob/402ce4c3/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 6698f94..2547ed5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -276,9 +276,9 @@ under the License.
         <version>${plexusInterpolationVersion}</version>
       </dependency>
       <dependency>
-        <groupId>org.fusesource.jansi</groupId>
-        <artifactId>jansi</artifactId>
-        <version>1.13</version>
+        <groupId>org.apache.maven.shared</groupId>
+        <artifactId>maven-project-utils</artifactId>
+        <version>1.0.0-SNAPSHOT</version>
       </dependency>
       <dependency>
         <groupId>org.slf4j</groupId>


Re: [2/5] maven git commit: [MNG-3507] use AnsiUtils API to use colors consistently

Posted by Hervé BOUTEMY <he...@free.fr>.
Le jeudi 23 juin 2016 21:39:02 Robert Scholte a écrit :
> >> > - move code to maven-shared-utils: the drawback here is to add jansi
> >> > dependency to the artifact.
> >> 
> >> That would pull in maven-shared-utils next to plexus-utils, which are
> >> comparable and shouldn't be mixed due to classloading issues as seen in
> >> the past.
> > 
> > classloading issues between maven-shared-utils and plexus-utils? how can
> > 2
> > separate pieces of code interfere?
> > 
> >> > Any preference? Any other idea?
> >> 
> >> So it seems like it should be a very small standalone module. It should
> >> also pick up jansi from the classpath, jansi shouldn't be a direct
> >> dependency, but a provided or optional one.
> > 
> > hiding JAnsi will require more code, but looks feasible
> > 
> > I'd really like to understand why maven-shared-utils would cause issues
> 
> IIRC https://issues.apache.org/jira/browse/MNG-2892 is the key issue here.
> However, nowadays plexus-utils is not shaded anymore, it is just another
> dependency. Not sure where everything changed again, but I think it is
> best that Maven uses plexus-utils, plugins use maven-shared-utils.
> AFAIK M2.0.5 was a quite a bad release due to the usage of different
> versions of plexus-utils between maven-core and the plugins.
now, Plexus XPP3 classes are exposed through META-INF/maven/extensions.xml in 
maven-core

adding maven-shared-utils as a dependency won't make anything visible from 
plugins

For the moment, I'll move code to maven-shared-utils: we'll see later if we 
want to move it further...

Regards,

Hervé

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: [2/5] maven git commit: [MNG-3507] use AnsiUtils API to use colors consistently

Posted by Robert Scholte <rf...@apache.org>.
On Thu, 23 Jun 2016 21:27:57 +0200, Hervé BOUTEMY <he...@free.fr>  
wrote:

> Le jeudi 23 juin 2016 19:54:58 Robert Scholte a écrit :
>> > thinking more about it.
>> > Yes, having Maven core depending on maven-project-utils, which  
>> dependes
>> > on
>> > maven-core, will cause issues: I already had to add an exclusion to
>> > avoid a
>> > build tests failure...
>> >
>> > Where to put AnsiUtils?
>> > I see multiple options:
>> > - a new Maven core module: the drawback I see is that it will be a  
>> really
>> > small artifact...
>>
>> A separate module or part of an existing module?
> a *new* module
>
>> This would mean that
>> plugins would require a newer version of maven dependencies just for
>> logging.
> it would require just this module, not every Maven core dependencies
>
>> This doesn't seem to be correct.
> one concrete drawback I see is that Maven core requires Java 7, where  
> most
> plugins are still with Java 6.
>>
>> > - move code to maven-plugin-api: it would be consistent. The drawback
>> > here is
>> > that we'll need to shade it into plugins to avoid Maven 3.4.0  
>> requirement
>>
>> Nope, see previous comment. Plugins should compile with lowest maven
>> dependencies.
>>
>> > - move code to maven-shared-utils: the drawback here is to add jansi
>> > dependency to the artifact.
>>
>> That would pull in maven-shared-utils next to plexus-utils, which are
>> comparable and shouldn't be mixed due to classloading issues as seen in
>> the past.
> classloading issues between maven-shared-utils and plexus-utils? how can  
> 2
> separate pieces of code interfere?
>
>>
>> > Any preference? Any other idea?
>>
>> So it seems like it should be a very small standalone module. It should
>> also pick up jansi from the classpath, jansi shouldn't be a direct
>> dependency, but a provided or optional one.
> hiding JAnsi will require more code, but looks feasible
>
> I'd really like to understand why maven-shared-utils would cause issues

IIRC https://issues.apache.org/jira/browse/MNG-2892 is the key issue here.  
However, nowadays plexus-utils is not shaded anymore, it is just another  
dependency. Not sure where everything changed again, but I think it is  
best that Maven uses plexus-utils, plugins use maven-shared-utils.
AFAIK M2.0.5 was a quite a bad release due to the usage of different  
versions of plexus-utils between maven-core and the plugins.

Robert

>
> Regards,
>
> Hervé
>
>>
>> that's the approach I would go for.
>>
>> Robert
>>
>> > Regards,
>> >
>> > Hervé
>> >
>> > Le mardi 21 juin 2016 08:33:48 Hervé BOUTEMY a écrit :
>> >> Le lundi 20 juin 2016 20:33:26 Christian Schulte a écrit :
>> >> > Am 06/20/16 um 19:15 schrieb Robert Scholte:
>> >> > > Hi Christian,
>> >> > >
>> >> > > when I introduced the maven-project-utils I had a library in mind
>> >>
>> >> with
>> >>
>> >> > > helpful MavenProject related methods for multiple plugins. For  
>> that
>> >> > > reason
>> >> > > I didn't make it part of the Maven distribution.
>> >> > > With this commit the library suddenly is required.
>> >> > > Instead I think you should use plain JAnsi or we should extract  
>> the
>> >> > > logging part from the library.
>> >> >
>> >> > Hervé committed this and is currently working on it.
>> >>
>> >> yes, I'm the culprit here :)
>> >>
>> >> > Colours disappeard
>> >> > on current 'master' here.
>> >>
>> >> same for me
>> >> the code that checks for Maven version before activating colors does  
>> not
>> >> work when run in Maven core...
>> >> I just activated color explicitely in Maven core, but since this code
>> >> will
>> >> also be responsible for custom colors injection (later, I still  
>> didn't
>> >> have
>> >> time to implement it), I don't think this will be the right answer
>> >>
>> >> > I am not sure using plain JAnsi is the way to
>> >> > go. I would prefer having some kind of facade people can use which
>> >> > allows us to replace JAnsi without the need to touch any code.
>> >>
>> >> replacing JAnsi probably won't happen
>> >> But this API is responsible for consistent and configable colors
>> >>
>> >> > Currently
>> >> > JAnsi still is on the compile classpath. That's like using classes  
>> of
>> >> > some 'com.sun' package. We have no compiler warning people about
>> >>
>> >> direct
>> >>
>> >> > use of JAnsi. So it better disappears from any compile classpath  
>> to be
>> >> > safe. Allowing direct use of JAnsi we also run into that 'everyone
>> >>
>> >> uses
>> >>
>> >> > colours in an inconsistent way' - like someone else already said -  
>> we
>> >> > will get that rainbow console effect sometime in the future (when
>> >>
>> >> people
>> >>
>> >> > start providing colours in theire plugins).
>> >>
>> >> this is where Java 9 modules would help...
>> >> For the moment, I don't think hiding JAnsi is a priority: explaining  
>> the
>> >> Maven color logging messages API is more important.
>> >>
>> >> > The API Hervé is working on
>> >> > looks promising. Maybe we make that a class in 'maven-core' instead
>> >>
>> >> of a
>> >>
>> >> > part of some library. Plugins already add 'maven-core' to theire
>> >>
>> >> compile
>> >>
>> >> > classpath.
>> >>
>> >> if we do that, doing plugins working on every Maven version will  
>> require
>> >> reflection: that's hard
>> >>
>> >> > That could pull in some kind of Ansi Logging helper class as
>> >> > well. No need for a separate library, I think.
>> >>
>> >> If using maven-project-utils in core is not ok, yes, we'll need a
>> >> separate
>> >> library
>> >>
>> >> Regards,
>> >>
>> >> Hervé
>> >>
>> >> > Regards,
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> >> For additional commands, e-mail: dev-help@maven.apache.org
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> > For additional commands, e-mail: dev-help@maven.apache.org
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: [2/5] maven git commit: [MNG-3507] use AnsiUtils API to use colors consistently

Posted by Hervé BOUTEMY <he...@free.fr>.
Le jeudi 23 juin 2016 19:54:58 Robert Scholte a écrit :
> > thinking more about it.
> > Yes, having Maven core depending on maven-project-utils, which dependes
> > on
> > maven-core, will cause issues: I already had to add an exclusion to
> > avoid a
> > build tests failure...
> > 
> > Where to put AnsiUtils?
> > I see multiple options:
> > - a new Maven core module: the drawback I see is that it will be a really
> > small artifact...
> 
> A separate module or part of an existing module?
a *new* module

> This would mean that
> plugins would require a newer version of maven dependencies just for
> logging.
it would require just this module, not every Maven core dependencies

> This doesn't seem to be correct.
one concrete drawback I see is that Maven core requires Java 7, where most 
plugins are still with Java 6.
> 
> > - move code to maven-plugin-api: it would be consistent. The drawback
> > here is
> > that we'll need to shade it into plugins to avoid Maven 3.4.0 requirement
> 
> Nope, see previous comment. Plugins should compile with lowest maven
> dependencies.
> 
> > - move code to maven-shared-utils: the drawback here is to add jansi
> > dependency to the artifact.
> 
> That would pull in maven-shared-utils next to plexus-utils, which are
> comparable and shouldn't be mixed due to classloading issues as seen in
> the past.
classloading issues between maven-shared-utils and plexus-utils? how can 2 
separate pieces of code interfere?

> 
> > Any preference? Any other idea?
> 
> So it seems like it should be a very small standalone module. It should
> also pick up jansi from the classpath, jansi shouldn't be a direct
> dependency, but a provided or optional one.
hiding JAnsi will require more code, but looks feasible

I'd really like to understand why maven-shared-utils would cause issues

Regards,

Hervé

> 
> that's the approach I would go for.
> 
> Robert
> 
> > Regards,
> > 
> > Hervé
> > 
> > Le mardi 21 juin 2016 08:33:48 Hervé BOUTEMY a écrit :
> >> Le lundi 20 juin 2016 20:33:26 Christian Schulte a écrit :
> >> > Am 06/20/16 um 19:15 schrieb Robert Scholte:
> >> > > Hi Christian,
> >> > > 
> >> > > when I introduced the maven-project-utils I had a library in mind
> >> 
> >> with
> >> 
> >> > > helpful MavenProject related methods for multiple plugins. For that
> >> > > reason
> >> > > I didn't make it part of the Maven distribution.
> >> > > With this commit the library suddenly is required.
> >> > > Instead I think you should use plain JAnsi or we should extract the
> >> > > logging part from the library.
> >> > 
> >> > Hervé committed this and is currently working on it.
> >> 
> >> yes, I'm the culprit here :)
> >> 
> >> > Colours disappeard
> >> > on current 'master' here.
> >> 
> >> same for me
> >> the code that checks for Maven version before activating colors does not
> >> work when run in Maven core...
> >> I just activated color explicitely in Maven core, but since this code
> >> will
> >> also be responsible for custom colors injection (later, I still didn't
> >> have
> >> time to implement it), I don't think this will be the right answer
> >> 
> >> > I am not sure using plain JAnsi is the way to
> >> > go. I would prefer having some kind of facade people can use which
> >> > allows us to replace JAnsi without the need to touch any code.
> >> 
> >> replacing JAnsi probably won't happen
> >> But this API is responsible for consistent and configable colors
> >> 
> >> > Currently
> >> > JAnsi still is on the compile classpath. That's like using classes of
> >> > some 'com.sun' package. We have no compiler warning people about
> >> 
> >> direct
> >> 
> >> > use of JAnsi. So it better disappears from any compile classpath to be
> >> > safe. Allowing direct use of JAnsi we also run into that 'everyone
> >> 
> >> uses
> >> 
> >> > colours in an inconsistent way' - like someone else already said - we
> >> > will get that rainbow console effect sometime in the future (when
> >> 
> >> people
> >> 
> >> > start providing colours in theire plugins).
> >> 
> >> this is where Java 9 modules would help...
> >> For the moment, I don't think hiding JAnsi is a priority: explaining the
> >> Maven color logging messages API is more important.
> >> 
> >> > The API Hervé is working on
> >> > looks promising. Maybe we make that a class in 'maven-core' instead
> >> 
> >> of a
> >> 
> >> > part of some library. Plugins already add 'maven-core' to theire
> >> 
> >> compile
> >> 
> >> > classpath.
> >> 
> >> if we do that, doing plugins working on every Maven version will require
> >> reflection: that's hard
> >> 
> >> > That could pull in some kind of Ansi Logging helper class as
> >> > well. No need for a separate library, I think.
> >> 
> >> If using maven-project-utils in core is not ok, yes, we'll need a
> >> separate
> >> library
> >> 
> >> Regards,
> >> 
> >> Hervé
> >> 
> >> > Regards,
> >> 
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: dev-help@maven.apache.org
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: [2/5] maven git commit: [MNG-3507] use AnsiUtils API to use colors consistently

Posted by Christian Schulte <cs...@schulte.it>.
Am 06/22/16 um 23:41 schrieb Herv BOUTEMY:
> - move code to maven-shared-utils: the drawback here is to add jansi 
> dependency to the artifact.

+1

Just flag it 'optional' so that people not using the Ansi related
classes do not get it on the classpath and do not need to exclude it
everywhere. While at it, the jsr305 dependency could also be flagged
'optional' instead of using scope 'provided'.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: [2/5] maven git commit: [MNG-3507] use AnsiUtils API to use colors consistently

Posted by Robert Scholte <rf...@apache.org>.
> thinking more about it.
> Yes, having Maven core depending on maven-project-utils, which dependes  
> on
> maven-core, will cause issues: I already had to add an exclusion to  
> avoid a
> build tests failure...
>
> Where to put AnsiUtils?
> I see multiple options:
> - a new Maven core module: the drawback I see is that it will be a really
> small artifact...

A separate module or part of an existing module? This would mean that  
plugins would require a newer version of maven dependencies just for  
logging. This doesn't seem to be correct.

> - move code to maven-plugin-api: it would be consistent. The drawback  
> here is
> that we'll need to shade it into plugins to avoid Maven 3.4.0 requirement

Nope, see previous comment. Plugins should compile with lowest maven  
dependencies.

> - move code to maven-shared-utils: the drawback here is to add jansi
> dependency to the artifact.

That would pull in maven-shared-utils next to plexus-utils, which are  
comparable and shouldn't be mixed due to classloading issues as seen in  
the past.

>
> Any preference? Any other idea?

So it seems like it should be a very small standalone module. It should  
also pick up jansi from the classpath, jansi shouldn't be a direct  
dependency, but a provided or optional one.

that's the approach I would go for.

Robert

>
> Regards,
>
> Hervé
>
> Le mardi 21 juin 2016 08:33:48 Hervé BOUTEMY a écrit :
>> Le lundi 20 juin 2016 20:33:26 Christian Schulte a écrit :
>> > Am 06/20/16 um 19:15 schrieb Robert Scholte:
>> > > Hi Christian,
>> > >
>> > > when I introduced the maven-project-utils I had a library in mind  
>> with
>> > > helpful MavenProject related methods for multiple plugins. For that
>> > > reason
>> > > I didn't make it part of the Maven distribution.
>> > > With this commit the library suddenly is required.
>> > > Instead I think you should use plain JAnsi or we should extract the
>> > > logging part from the library.
>> >
>> > Hervé committed this and is currently working on it.
>>
>> yes, I'm the culprit here :)
>>
>> > Colours disappeard
>> > on current 'master' here.
>>
>> same for me
>> the code that checks for Maven version before activating colors does not
>> work when run in Maven core...
>> I just activated color explicitely in Maven core, but since this code  
>> will
>> also be responsible for custom colors injection (later, I still didn't  
>> have
>> time to implement it), I don't think this will be the right answer
>>
>> > I am not sure using plain JAnsi is the way to
>> > go. I would prefer having some kind of facade people can use which
>> > allows us to replace JAnsi without the need to touch any code.
>>
>> replacing JAnsi probably won't happen
>> But this API is responsible for consistent and configable colors
>>
>> > Currently
>> > JAnsi still is on the compile classpath. That's like using classes of
>> > some 'com.sun' package. We have no compiler warning people about  
>> direct
>> > use of JAnsi. So it better disappears from any compile classpath to be
>> > safe. Allowing direct use of JAnsi we also run into that 'everyone  
>> uses
>> > colours in an inconsistent way' - like someone else already said - we
>> > will get that rainbow console effect sometime in the future (when  
>> people
>> > start providing colours in theire plugins).
>>
>> this is where Java 9 modules would help...
>> For the moment, I don't think hiding JAnsi is a priority: explaining the
>> Maven color logging messages API is more important.
>>
>> > The API Hervé is working on
>> > looks promising. Maybe we make that a class in 'maven-core' instead  
>> of a
>> > part of some library. Plugins already add 'maven-core' to theire  
>> compile
>> > classpath.
>>
>> if we do that, doing plugins working on every Maven version will require
>> reflection: that's hard
>>
>> > That could pull in some kind of Ansi Logging helper class as
>> > well. No need for a separate library, I think.
>>
>> If using maven-project-utils in core is not ok, yes, we'll need a  
>> separate
>> library
>>
>> Regards,
>>
>> Hervé
>>
>> > Regards,
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: [2/5] maven git commit: [MNG-3507] use AnsiUtils API to use colors consistently

Posted by Hervé BOUTEMY <he...@free.fr>.
thinking more about it.
Yes, having Maven core depending on maven-project-utils, which dependes on 
maven-core, will cause issues: I already had to add an exclusion to avoid a 
build tests failure...

Where to put AnsiUtils?
I see multiple options:
- a new Maven core module: the drawback I see is that it will be a really 
small artifact...
- move code to maven-plugin-api: it would be consistent. The drawback here is 
that we'll need to shade it into plugins to avoid Maven 3.4.0 requirement
- move code to maven-shared-utils: the drawback here is to add jansi 
dependency to the artifact.

Any preference? Any other idea?

Regards,

Hervé

Le mardi 21 juin 2016 08:33:48 Hervé BOUTEMY a écrit :
> Le lundi 20 juin 2016 20:33:26 Christian Schulte a écrit :
> > Am 06/20/16 um 19:15 schrieb Robert Scholte:
> > > Hi Christian,
> > > 
> > > when I introduced the maven-project-utils I had a library in mind with
> > > helpful MavenProject related methods for multiple plugins. For that
> > > reason
> > > I didn't make it part of the Maven distribution.
> > > With this commit the library suddenly is required.
> > > Instead I think you should use plain JAnsi or we should extract the
> > > logging part from the library.
> > 
> > Hervé committed this and is currently working on it.
> 
> yes, I'm the culprit here :)
> 
> > Colours disappeard
> > on current 'master' here.
> 
> same for me
> the code that checks for Maven version before activating colors does not
> work when run in Maven core...
> I just activated color explicitely in Maven core, but since this code will
> also be responsible for custom colors injection (later, I still didn't have
> time to implement it), I don't think this will be the right answer
> 
> > I am not sure using plain JAnsi is the way to
> > go. I would prefer having some kind of facade people can use which
> > allows us to replace JAnsi without the need to touch any code.
> 
> replacing JAnsi probably won't happen
> But this API is responsible for consistent and configable colors
> 
> > Currently
> > JAnsi still is on the compile classpath. That's like using classes of
> > some 'com.sun' package. We have no compiler warning people about direct
> > use of JAnsi. So it better disappears from any compile classpath to be
> > safe. Allowing direct use of JAnsi we also run into that 'everyone uses
> > colours in an inconsistent way' - like someone else already said - we
> > will get that rainbow console effect sometime in the future (when people
> > start providing colours in theire plugins).
> 
> this is where Java 9 modules would help...
> For the moment, I don't think hiding JAnsi is a priority: explaining the
> Maven color logging messages API is more important.
> 
> > The API Hervé is working on
> > looks promising. Maybe we make that a class in 'maven-core' instead of a
> > part of some library. Plugins already add 'maven-core' to theire compile
> > classpath.
> 
> if we do that, doing plugins working on every Maven version will require
> reflection: that's hard
> 
> > That could pull in some kind of Ansi Logging helper class as
> > well. No need for a separate library, I think.
> 
> If using maven-project-utils in core is not ok, yes, we'll need a separate
> library
> 
> Regards,
> 
> Hervé
> 
> > Regards,
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: [2/5] maven git commit: [MNG-3507] use AnsiUtils API to use colors consistently

Posted by Hervé BOUTEMY <he...@free.fr>.
Le lundi 20 juin 2016 20:33:26 Christian Schulte a écrit :
> Am 06/20/16 um 19:15 schrieb Robert Scholte:
> > Hi Christian,
> > 
> > when I introduced the maven-project-utils I had a library in mind with
> > helpful MavenProject related methods for multiple plugins. For that reason
> > I didn't make it part of the Maven distribution.
> > With this commit the library suddenly is required.
> > Instead I think you should use plain JAnsi or we should extract the
> > logging part from the library.
> 
> Hervé committed this and is currently working on it.
yes, I'm the culprit here :)

> Colours disappeard
> on current 'master' here.
same for me
the code that checks for Maven version before activating colors does not work 
when run in Maven core...
I just activated color explicitely in Maven core, but since this code will 
also be responsible for custom colors injection (later, I still didn't have 
time to implement it), I don't think this will be the right answer

> I am not sure using plain JAnsi is the way to
> go. I would prefer having some kind of facade people can use which
> allows us to replace JAnsi without the need to touch any code.
replacing JAnsi probably won't happen
But this API is responsible for consistent and configable colors

> Currently
> JAnsi still is on the compile classpath. That's like using classes of
> some 'com.sun' package. We have no compiler warning people about direct
> use of JAnsi. So it better disappears from any compile classpath to be
> safe. Allowing direct use of JAnsi we also run into that 'everyone uses
> colours in an inconsistent way' - like someone else already said - we
> will get that rainbow console effect sometime in the future (when people
> start providing colours in theire plugins).
this is where Java 9 modules would help...
For the moment, I don't think hiding JAnsi is a priority: explaining the Maven 
color logging messages API is more important.

> The API Hervé is working on
> looks promising. Maybe we make that a class in 'maven-core' instead of a
> part of some library. Plugins already add 'maven-core' to theire compile
> classpath.
if we do that, doing plugins working on every Maven version will require 
reflection: that's hard

> That could pull in some kind of Ansi Logging helper class as
> well. No need for a separate library, I think.
If using maven-project-utils in core is not ok, yes, we'll need a separate 
library

Regards,

Hervé

> 
> Regards,


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: [2/5] maven git commit: [MNG-3507] use AnsiUtils API to use colors consistently

Posted by Christian Schulte <sc...@apache.org>.
Am 06/20/16 um 19:15 schrieb Robert Scholte:
> Hi Christian,
> 
> when I introduced the maven-project-utils I had a library in mind with  
> helpful MavenProject related methods for multiple plugins. For that reason  
> I didn't make it part of the Maven distribution.
> With this commit the library suddenly is required.
> Instead I think you should use plain JAnsi or we should extract the  
> logging part from the library.
> 

Herv committed this and is currently working on it. Colours disappeard
on current 'master' here. I am not sure using plain JAnsi is the way to
go. I would prefer having some kind of facade people can use which
allows us to replace JAnsi without the need to touch any code. Currently
JAnsi still is on the compile classpath. That's like using classes of
some 'com.sun' package. We have no compiler warning people about direct
use of JAnsi. So it better disappears from any compile classpath to be
safe. Allowing direct use of JAnsi we also run into that 'everyone uses
colours in an inconsistent way' - like someone else already said - we
will get that rainbow console effect sometime in the future (when people
start providing colours in theire plugins). The API Herv is working on
looks promising. Maybe we make that a class in 'maven-core' instead of a
part of some library. Plugins already add 'maven-core' to theire compile
classpath. That could pull in some kind of Ansi Logging helper class as
well. No need for a separate library, I think.

Regards,
-- 
Christian


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: [2/5] maven git commit: [MNG-3507] use AnsiUtils API to use colors consistently

Posted by Robert Scholte <rf...@apache.org>.
Hi Christian,

when I introduced the maven-project-utils I had a library in mind with  
helpful MavenProject related methods for multiple plugins. For that reason  
I didn't make it part of the Maven distribution.
With this commit the library suddenly is required.
Instead I think you should use plain JAnsi or we should extract the  
logging part from the library.

thanks,
Robert


On Mon, 20 Jun 2016 01:15:05 +0200, <sc...@apache.org> wrote:

> [MNG-3507] use AnsiUtils API to use colors consistently
>
> Project: http://git-wip-us.apache.org/repos/asf/maven/repo
> Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/402ce4c3
> Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/402ce4c3
> Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/402ce4c3
>
> Branch: refs/heads/MNG-6006
> Commit: 402ce4c3cd1e970d2d4186aa6fc3e10c612241fb
> Parents: 162c740
> Author: Hervé Boutemy <hb...@apache.org>
> Authored: Mon Jun 20 00:35:17 2016 +0200
> Committer: Hervé Boutemy <hb...@apache.org>
> Committed: Mon Jun 20 00:35:41 2016 +0200
>
> ----------------------------------------------------------------------
>  maven-core/pom.xml                              | 10 +++-
>  .../lifecycle/LifecycleExecutionException.java  | 19 ++++----
>  maven-embedder/pom.xml                          |  4 +-
>  .../org/apache/maven/cli/CLIReportingUtils.java |  4 +-
>  .../java/org/apache/maven/cli/MavenCli.java     | 21 ++++----
>  .../maven/cli/event/ExecutionEventLogger.java   | 50  
> ++++++++++----------
>  .../cli/logging/impl/gossip/ColorRenderer.java  | 26 +++++-----
>  pom.xml                                         |  6 +--
>  8 files changed, 72 insertions(+), 68 deletions(-)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/maven/blob/402ce4c3/maven-core/pom.xml
> ----------------------------------------------------------------------
> diff --git a/maven-core/pom.xml b/maven-core/pom.xml
> index cc648be..f03eead 100644
> --- a/maven-core/pom.xml
> +++ b/maven-core/pom.xml
> @@ -85,8 +85,14 @@ under the License.
>        <artifactId>aether-util</artifactId>
>      </dependency>
>      <dependency>
> -      <groupId>org.fusesource.jansi</groupId>
> -      <artifactId>jansi</artifactId>
> +      <groupId>org.apache.maven.shared</groupId>
> +      <artifactId>maven-project-utils</artifactId>
> +      <exclusions>
> +        <exclusion>
> +          <groupId>org.apache.maven</groupId>
> +          <artifactId>maven-core</artifactId>
> +        </exclusion>
> +      </exclusions>
>      </dependency>
>      <!-- Plexus -->
>      <dependency>
>
> http://git-wip-us.apache.org/repos/asf/maven/blob/402ce4c3/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleExecutionException.java
> ----------------------------------------------------------------------
> diff --git  
> a/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleExecutionException.java  
> b/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleExecutionException.java
> index fd4bca0..5645abd 100644
> ---  
> a/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleExecutionException.java
> +++  
> b/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleExecutionException.java
> @@ -19,11 +19,11 @@ package org.apache.maven.lifecycle;
>   * under the License.
>   */
> -import static org.fusesource.jansi.Ansi.ansi;
> +import static org.apache.maven.shared.project.utils.AnsiUtils.ansi;
> import org.apache.maven.plugin.MojoExecution;
>  import org.apache.maven.project.MavenProject;
> -import org.fusesource.jansi.Ansi;
> +import org.apache.maven.shared.project.utils.AnsiUtils;
> /**
>   * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
> @@ -78,26 +78,27 @@ public class LifecycleExecutionException
>     private static String createMessage( MojoExecution execution,  
> MavenProject project, Throwable cause )
>      {
> -        Ansi buffer = ansi( /*256*/ );
> +        AnsiUtils buffer = ansi( 256 );
> -        buffer.a( "Failed to execute goal" ).reset();
> +        buffer.a( "Failed to execute goal" );
>         if ( execution != null )
>          {
> -            buffer.a( ' ' ).a( execution.getGroupId() ).a( ':'  
> ).fgGreen().a( execution.getArtifactId() );
> -            buffer.a( ':' ).a( execution.getVersion() ).a( ':' ).a(  
> execution.getGoal() ).reset();
> -            buffer.bold().a( " (" ).a( execution.getExecutionId() ).a(  
> ')' ).reset();
> +            buffer.a( ' ' ).a( execution.getGroupId() ).a( ':' );
> +            buffer.mojo().a( execution.getArtifactId() ).a( ':' );
> +            buffer.a( execution.getVersion() ).a( ':' ).a(  
> execution.getGoal() ).reset();
> +            buffer.strong().a( " (" ).a( execution.getExecutionId()  
> ).a( ')' ).reset();
>          }
>         if ( project != null )
>          {
>              buffer.a( " on project " );
> -            buffer.fgCyan().a( project.getArtifactId() ).reset();
> +            buffer.project( project.getArtifactId() );
>          }
>         if ( cause != null )
>          {
> -            buffer.a( ": " ).bold().fgRed().a( cause.getMessage()  
> ).reset();
> +            buffer.a( ": " ).failure( cause.getMessage() );
>          }
>         return buffer.toString();
>
> http://git-wip-us.apache.org/repos/asf/maven/blob/402ce4c3/maven-embedder/pom.xml
> ----------------------------------------------------------------------
> diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml
> index eb72f93..7e4032f 100644
> --- a/maven-embedder/pom.xml
> +++ b/maven-embedder/pom.xml
> @@ -80,8 +80,8 @@ under the License.
>        <artifactId>plexus-cipher</artifactId>
>      </dependency>
>      <dependency>
> -      <groupId>org.fusesource.jansi</groupId>
> -      <artifactId>jansi</artifactId>
> +      <groupId>org.apache.maven.shared</groupId>
> +      <artifactId>maven-project-utils</artifactId>
>      </dependency>
>      <dependency>
>        <groupId>org.slf4j</groupId>
>
> http://git-wip-us.apache.org/repos/asf/maven/blob/402ce4c3/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java
> ----------------------------------------------------------------------
> diff --git  
> a/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java  
> b/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java
> index 18e43ef..aa28b27 100644
> ---  
> a/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java
> +++  
> b/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java
> @@ -19,7 +19,7 @@ package org.apache.maven.cli;
>   * under the License.
>   */
> -import static org.fusesource.jansi.Ansi.ansi;
> +import static org.apache.maven.shared.project.utils.AnsiUtils.ansi;
> import java.io.IOException;
>  import java.io.InputStream;
> @@ -57,7 +57,7 @@ public final class CLIReportingUtils
>          final String ls = System.getProperty( "line.separator" );
>          Properties properties = getBuildProperties();
>          StringBuilder version = new StringBuilder( 256 );
> -        version.append( ansi().bold().a( createMavenVersionString(  
> properties ) ).reset() ).append( ls );
> +        version.append( ansi().strong( createMavenVersionString(  
> properties ) ) ).append( ls );
>          version.append( reduce(
>              properties.getProperty( "distributionShortName" ) + " home:  
> " + System.getProperty( "maven.home",
>                                                                                                  "<unknown  
> Maven "
>
> http://git-wip-us.apache.org/repos/asf/maven/blob/402ce4c3/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 b07fdc9..fd0a81a 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,7 +19,7 @@ package org.apache.maven.cli;
>   * under the License.
>   */
> -import static org.fusesource.jansi.Ansi.ansi;
> +import static org.apache.maven.shared.project.utils.AnsiUtils.ansi;
> import java.io.BufferedInputStream;
>  import java.io.Console;
> @@ -91,6 +91,7 @@ import org.apache.maven.model.profile.ProfileSelector;
>  import org.apache.maven.project.MavenProject;
>  import org.apache.maven.properties.internal.EnvironmentUtils;
>  import org.apache.maven.properties.internal.SystemProperties;
> +import org.apache.maven.shared.project.utils.AnsiUtils;
>  import  
> org.apache.maven.toolchain.building.DefaultToolchainsBuildingRequest;
>  import org.apache.maven.toolchain.building.ToolchainsBuilder;
>  import org.apache.maven.toolchain.building.ToolchainsBuildingResult;
> @@ -110,8 +111,6 @@ import com.google.common.base.Charsets;
>  import com.google.common.io.Files;
>  import com.google.inject.AbstractModule;
>  import org.eclipse.aether.transfer.TransferListener;
> -import org.fusesource.jansi.Ansi;
> -import org.fusesource.jansi.AnsiConsole;
>  import org.slf4j.ILoggerFactory;
>  import org.slf4j.Logger;
>  import org.slf4j.LoggerFactory;
> @@ -212,9 +211,9 @@ public class MavenCli
>      {
>          MavenCli cli = new MavenCli();
> -        AnsiConsole.systemInstall();
> +        AnsiUtils.systemInstall();
>          int result = cli.doMain( new CliRequest( args, classWorld ) );
> -        AnsiConsole.systemUninstall();
> +        AnsiUtils.systemUninstall();
>         return result;
>      }
> @@ -476,7 +475,7 @@ public class MavenCli
>         if ( cliRequest.commandLine.hasOption( CLIManager.BATCH_MODE ) )
>          {
> -            Ansi.setEnabled( false );
> +            AnsiUtils.setEnabled( false );
>          }
>         if ( cliRequest.commandLine.hasOption( CLIManager.LOG_FILE ) )
> @@ -484,7 +483,7 @@ public class MavenCli
>              File logFile = new File(  
> cliRequest.commandLine.getOptionValue( CLIManager.LOG_FILE ) );
>              logFile = resolveFile( logFile, cliRequest.workingDirectory  
> );
> -            Ansi.setEnabled( false );
> +            AnsiUtils.setEnabled( false );
>             // redirect stdout and stderr to file
>              try
> @@ -1021,11 +1020,11 @@ public class MavenCli
>              if ( !cliRequest.showErrors )
>              {
>                  slf4jLogger.error( "To see the full stack trace of the  
> errors, re-run Maven with the "
> -                    + ansi().bold().a( "-e" ).reset() + " switch." );
> +                    + ansi().strong( "-e" ) + " switch." );
>              }
>              if ( !slf4jLogger.isDebugEnabled() )
>              {
> -                slf4jLogger.error( "Re-run Maven using the " +  
> ansi().bold().a( "-X" ).reset()
> +                slf4jLogger.error( "Re-run Maven using the " +  
> ansi().strong( "-X" )
>                      + " switch to enable full debug logging." );
>              }
> @@ -1037,7 +1036,7 @@ public class MavenCli
>                 for ( Map.Entry<String, String> entry :  
> references.entrySet() )
>                  {
> -                    slf4jLogger.error( ansi().bold().a(  
> entry.getValue() ).reset() + " " + entry.getKey() );
> +                    slf4jLogger.error( ansi().strong( entry.getValue()  
> ) + " " + entry.getKey() );
>                  }
>              }
> @@ -1045,7 +1044,7 @@ public class MavenCli
>              {
>                  slf4jLogger.error( "" );
>                  slf4jLogger.error( "After correcting the problems, you  
> can resume the build with the command" );
> -                slf4jLogger.error( ansi().bold().a( "  mvn <goals> -rf  
> :" )
> +                slf4jLogger.error( ansi().strong().a( "  mvn <goals>  
> -rf :" )
>                                     .a( project.getArtifactId()  
> ).reset().toString() );
>              }
>
> http://git-wip-us.apache.org/repos/asf/maven/blob/402ce4c3/maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java
> ----------------------------------------------------------------------
> diff --git  
> a/maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java  
> b/maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java
> index ee57121..9b3bad4 100644
> ---  
> a/maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java
> +++  
> b/maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java
> @@ -21,7 +21,7 @@ package org.apache.maven.cli.event;
> import static org.apache.maven.cli.CLIReportingUtils.formatDuration;
>  import static org.apache.maven.cli.CLIReportingUtils.formatTimestamp;
> -import static org.fusesource.jansi.Ansi.ansi;
> +import static org.apache.maven.shared.project.utils.AnsiUtils.ansi;
> import org.apache.commons.lang3.Validate;
>  import org.apache.maven.execution.AbstractExecutionListener;
> @@ -34,8 +34,8 @@ import org.apache.maven.execution.MavenSession;
>  import org.apache.maven.plugin.MojoExecution;
>  import org.apache.maven.plugin.descriptor.MojoDescriptor;
>  import org.apache.maven.project.MavenProject;
> +import org.apache.maven.shared.project.utils.AnsiUtils;
>  import org.codehaus.plexus.util.StringUtils;
> -import org.fusesource.jansi.Ansi;
>  import org.slf4j.Logger;
>  import org.slf4j.LoggerFactory;
> @@ -83,7 +83,7 @@ public class ExecutionEventLogger
>     private void infoMain( String msg )
>      {
> -        logger.info( ansi().bold().a( msg ).reset().toString() );
> +        logger.info( ansi().strong( msg ).toString() );
>      }
>     @Override
> @@ -161,11 +161,11 @@ public class ExecutionEventLogger
>             if ( buildSummary == null )
>              {
> -                buffer.append( ansi().bold().fgYellow().a( "SKIPPED"  
> ).reset() );
> +                buffer.append( ansi().warning( "SKIPPED" ) );
>              }
>              else if ( buildSummary instanceof BuildSuccess )
>              {
> -                buffer.append( ansi().bold().fgGreen().a( "SUCCESS"  
> ).reset() );
> +                buffer.append( ansi().success( "SUCCESS" ) );
>                  buffer.append( " [" );
>                  String buildTimeDuration = formatDuration(  
> buildSummary.getTime() );
>                  int padSize = MAX_PADDED_BUILD_TIME_DURATION_LENGTH -  
> buildTimeDuration.length();
> @@ -178,7 +178,7 @@ public class ExecutionEventLogger
>              }
>              else if ( buildSummary instanceof BuildFailure )
>              {
> -                buffer.append( ansi().bold().fgRed().a( "FAILURE"  
> ).reset() );
> +                buffer.append( ansi().failure( "FAILURE" ) );
>                  buffer.append( " [" );
>                  String buildTimeDuration = formatDuration(  
> buildSummary.getTime() );
>                  int padSize = MAX_PADDED_BUILD_TIME_DURATION_LENGTH -  
> buildTimeDuration.length();
> @@ -197,17 +197,17 @@ public class ExecutionEventLogger
>      private void logResult( MavenSession session )
>      {
>          infoLine( '-' );
> -        Ansi ansi = ansi().bold();
> +        AnsiUtils ansi = ansi();
>         if ( session.getResult().hasExceptions() )
>          {
> -            ansi.fgRed().a( "BUILD FAILURE" );
> +            ansi.failure( "BUILD FAILURE" );
>          }
>          else
>          {
> -            ansi.fgGreen().a( "BUILD SUCCESS" );
> +            ansi.success( "BUILD SUCCESS" );
>          }
> -        logger.info( ansi.reset().toString() );
> +        logger.info( ansi.toString() );
>      }
>     private void logStats( MavenSession session )
> @@ -282,10 +282,10 @@ public class ExecutionEventLogger
>          {
>              logger.info( "" );
> -            Ansi ansi = ansi().bold().a( "--- " ).reset();
> +            AnsiUtils ansi = ansi().strong( "--- " );
>              append( ansi, event.getMojoExecution() );
>              append( ansi, event.getProject() );
> -            ansi.bold().a( " ---" ).reset();
> +            ansi.strong( " ---" );
>             logger.info( ansi.toString() );
>          }
> @@ -302,12 +302,12 @@ public class ExecutionEventLogger
>          {
>              logger.info( "" );
> -            Ansi ansi = ansi().bold().a( ">>> " ).reset();
> +            AnsiUtils ansi = ansi().strong( ">>> " );
>              append( ansi, event.getMojoExecution() );
> -            ansi.bold().a( " > " ).reset();
> +            ansi.strong( " > " );
>              appendForkInfo( ansi,  
> event.getMojoExecution().getMojoDescriptor() );
>              append( ansi, event.getProject() );
> -            ansi.bold().a( " >>>" ).reset();
> +            ansi.strong( " >>>" );
>             logger.info( ansi.toString() );
>          }
> @@ -326,30 +326,30 @@ public class ExecutionEventLogger
>          {
>              logger.info( "" );
> -            Ansi ansi = ansi().bold().a( "<<< " ).reset();
> +            AnsiUtils ansi = ansi().strong( "<<< " );
>              append( ansi, event.getMojoExecution() );
> -            ansi.bold().a( " < " ).reset();
> +            ansi.strong( " < " );
>              appendForkInfo( ansi,  
> event.getMojoExecution().getMojoDescriptor() );
>              append( ansi, event.getProject() );
> -            ansi.bold().a( " <<<" ).reset();
> +            ansi.strong( " <<<" );
>             logger.info( ansi.toString() );
>          }
>      }
> -    private void append( Ansi ansi, MojoExecution me )
> +    private void append( AnsiUtils ansi, MojoExecution me )
>      {
> -        ansi.fgGreen().a( me.getArtifactId() ).a( ':' ).a(  
> me.getVersion() );
> +        ansi.mojo().a( me.getArtifactId() ).a( ':' ).a( me.getVersion()  
> );
>          ansi.a( ':' ).a( me.getGoal() ).reset();
>          if ( me.getExecutionId() != null )
>          {
> -            ansi.bold().a( " (" ).a( me.getExecutionId() ).a( ')'  
> ).reset();
> +            ansi.strong( " (" ).a( me.getExecutionId() ).a( ')' );
>          }
>      }
> -    private void appendForkInfo( Ansi ansi, MojoDescriptor md )
> +    private void appendForkInfo( AnsiUtils ansi, MojoDescriptor md )
>      {
> -        ansi.bold();
> +        ansi.strong();
>          if ( StringUtils.isNotEmpty( md.getExecutePhase() ) )
>          {
>              // forked phase
> @@ -370,9 +370,9 @@ public class ExecutionEventLogger
>          ansi.reset();
>      }
> -    private void append( Ansi ansi, MavenProject project )
> +    private void append( AnsiUtils ansi, MavenProject project )
>      {
> -        ansi.a( " @ " ).fgCyan().a( project.getArtifactId() ).reset();
> +        ansi.a( " @ " ).project( project.getArtifactId() );
>      }
>     @Override
>
> http://git-wip-us.apache.org/repos/asf/maven/blob/402ce4c3/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/gossip/ColorRenderer.java
> ----------------------------------------------------------------------
> diff --git  
> a/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/gossip/ColorRenderer.java  
> b/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/gossip/ColorRenderer.java
> index 52e0489..ba0c20a 100644
> ---  
> a/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/gossip/ColorRenderer.java
> +++  
> b/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/gossip/ColorRenderer.java
> @@ -19,7 +19,7 @@ package org.apache.maven.cli.logging.impl.gossip;
>   * under the License.
>   */
> -import static org.fusesource.jansi.Ansi.ansi;
> +import static org.apache.maven.shared.project.utils.AnsiUtils.ansi;
> import com.planet57.gossip.Event;
>  import com.planet57.gossip.Level;
> @@ -46,20 +46,20 @@ extends com.planet57.gossip.render.PatternRenderer
>          {
>              case TRACE:
>              case DEBUG:
> -                buff.append( ansi().bold().fgCyan().a( level.name()  
> ).reset() );
> +                buff.append( ansi().debug().a( level.name() ).reset() );
>                  break;
>             case INFO:
> -                buff.append( ansi().bold().fgBlue().a( level.name()  
> ).reset() );
> +                buff.append( ansi().info().a( level.name() ).reset() );
>                  break;
>             case WARN:
>                  // Maven uses WARNING instead of WARN
> -                buff.append( ansi().bold().fgYellow().a( WARNING  
> ).reset() );
> +                buff.append( ansi().warning().a( WARNING ).reset() );
>                  break;
>             case ERROR:
> -                buff.append( ansi().bold().fgRed().a( level.name()  
> ).reset() );
> +                buff.append( ansi().error().a( level.name() ).reset() );
>                  break;
>             default:
> @@ -72,7 +72,7 @@ extends com.planet57.gossip.render.PatternRenderer
>      {
>          StringBuilder tmp = new StringBuilder();
>          super.renderName( event, tmp, shortName );
> -        buff.append( ansi().fgGreen().a( tmp ).reset() );
> +        buff.append( ansi().success( tmp ) );
>      }
> @@ -88,11 +88,11 @@ extends com.planet57.gossip.render.PatternRenderer
>              return;
>          }
> -        buff.append( ansi().bold().fgRed().a(  
> cause.getClass().getName() ).reset() );
> +        buff.append( ansi().failure( cause.getClass().getName() ) );
>          if ( cause.getMessage() != null )
>          {
>              buff.append( ": " );
> -            buff.append( ansi().bold().fgRed().a( cause.getMessage()  
> ).reset() );
> +            buff.append( ansi().failure( cause.getMessage() ) );
>          }
>          renderNewLine( buff );
> @@ -101,21 +101,19 @@ extends com.planet57.gossip.render.PatternRenderer
>              for ( StackTraceElement e : cause.getStackTrace() )
>              {
>                  buff.append( "    " );
> -                buff.append( ansi().bold().a( "at" ).reset().a( " " )
> -                        .a( e.getClassName() ).a( "." ).a(  
> e.getMethodName() ) );
> -                buff.append( ansi().a( " (" ).bold().a( getLocation( e  
> ) ).reset().a( ")" ) );
> +                buff.append( ansi().strong( "at" ).a( " " ).a(  
> e.getClassName() ).a( "." ).a( e.getMethodName() ) );
> +                buff.append( ansi().a( " (" ).strong( getLocation( e )  
> ).a( ")" ) );
>                  renderNewLine( buff );
>              }
>             cause = cause.getCause();
>              if ( cause != null )
>              {
> -                buff.append( ansi().bold().a( "Caused by" ).reset().a(  
> ": " )
> -                        .a( cause.getClass().getName() ) );
> +                buff.append( ansi().strong( "Caused by" ).a( ": " ).a(  
> cause.getClass().getName() ) );
>                  if ( cause.getMessage() != null )
>                  {
>                      buff.append( ": " );
> -                    buff.append( ansi().bold().fgRed().a(  
> cause.getMessage() ).reset() );
> +                    buff.append( ansi().failure( cause.getMessage() ) );
>                  }
>                  renderNewLine( buff );
>              }
>
> http://git-wip-us.apache.org/repos/asf/maven/blob/402ce4c3/pom.xml
> ----------------------------------------------------------------------
> diff --git a/pom.xml b/pom.xml
> index 6698f94..2547ed5 100644
> --- a/pom.xml
> +++ b/pom.xml
> @@ -276,9 +276,9 @@ under the License.
>          <version>${plexusInterpolationVersion}</version>
>        </dependency>
>        <dependency>
> -        <groupId>org.fusesource.jansi</groupId>
> -        <artifactId>jansi</artifactId>
> -        <version>1.13</version>
> +        <groupId>org.apache.maven.shared</groupId>
> +        <artifactId>maven-project-utils</artifactId>
> +        <version>1.0.0-SNAPSHOT</version>
>        </dependency>
>        <dependency>
>          <groupId>org.slf4j</groupId>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org