From e3c477e887a26d91e25e9bae386f33ee56ff6d67 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Wed, 26 Aug 2009 20:49:20 +0000 Subject: [PATCH] o Improved readability of log output git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@808183 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/cli/ExecutionEventLogger.java | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/ExecutionEventLogger.java b/maven-embedder/src/main/java/org/apache/maven/cli/ExecutionEventLogger.java index 3f1b16fcfc..d1fc182256 100644 --- a/maven-embedder/src/main/java/org/apache/maven/cli/ExecutionEventLogger.java +++ b/maven-embedder/src/main/java/org/apache/maven/cli/ExecutionEventLogger.java @@ -32,8 +32,7 @@ import org.apache.maven.execution.ExecutionEvent; import org.apache.maven.execution.MavenExecutionResult; import org.apache.maven.execution.MavenSession; import org.apache.maven.lifecycle.AbstractExecutionListener; -import org.apache.maven.plugin.descriptor.MojoDescriptor; -import org.apache.maven.plugin.descriptor.PluginDescriptor; +import org.apache.maven.plugin.MojoExecution; import org.apache.maven.project.MavenProject; /** @@ -115,8 +114,6 @@ class ExecutionEventLogger { logger.info( project.getName() ); } - - logger.info( "" ); } } @@ -224,6 +221,7 @@ class ExecutionEventLogger { if ( logger.isInfoEnabled() ) { + logger.info( chars( ' ', LINE_LENGTH ) ); logger.info( chars( '-', LINE_LENGTH ) ); logger.info( "Skipping " + event.getProject().getName() ); @@ -238,6 +236,7 @@ class ExecutionEventLogger { if ( logger.isInfoEnabled() ) { + logger.info( chars( ' ', LINE_LENGTH ) ); logger.info( chars( '-', LINE_LENGTH ) ); logger.info( "Building " + event.getProject().getName() ); @@ -251,7 +250,7 @@ class ExecutionEventLogger { if ( logger.isWarnEnabled() ) { - logger.warn( "Goal " + event.getMojoExecution().getMojoDescriptor().getGoal() + logger.warn( "Goal " + event.getMojoExecution().getGoal() + " requires online mode for execution but Maven is currently offline, skipping" ); } } @@ -261,10 +260,20 @@ class ExecutionEventLogger { if ( logger.isInfoEnabled() ) { - MojoDescriptor md = event.getMojoExecution().getMojoDescriptor(); - PluginDescriptor pd = md.getPluginDescriptor(); - logger.info( "Executing " + pd.getArtifactId() + ':' + pd.getVersion() + ':' + md.getGoal() + " on " - + event.getProject().getArtifactId() ); + MojoExecution me = event.getMojoExecution(); + StringBuilder buffer = new StringBuilder( 128 ); + + buffer.append( "--- " ); + buffer.append( me.getArtifactId() ).append( ':' ).append( me.getVersion() ); + buffer.append( ':' ).append( me.getGoal() ); + if ( me.getExecutionId() != null ) + { + buffer.append( " (" ).append( me.getExecutionId() ).append( ')' ); + } + buffer.append( " ---" ); + + logger.info( "" ); + logger.info( buffer.toString() ); } }