o Improved readability of log output

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@808183 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-08-26 20:49:20 +00:00
parent 8ce8b462d0
commit e3c477e887
1 changed files with 18 additions and 9 deletions

View File

@ -32,8 +32,7 @@
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 @@ public void sessionStarted( ExecutionEvent event )
{
logger.info( project.getName() );
}
logger.info( "" );
}
}
@ -224,6 +221,7 @@ public void projectSkipped( ExecutionEvent event )
{
if ( logger.isInfoEnabled() )
{
logger.info( chars( ' ', LINE_LENGTH ) );
logger.info( chars( '-', LINE_LENGTH ) );
logger.info( "Skipping " + event.getProject().getName() );
@ -238,6 +236,7 @@ public void projectStarted( ExecutionEvent event )
{
if ( logger.isInfoEnabled() )
{
logger.info( chars( ' ', LINE_LENGTH ) );
logger.info( chars( '-', LINE_LENGTH ) );
logger.info( "Building " + event.getProject().getName() );
@ -251,7 +250,7 @@ public void mojoSkipped( ExecutionEvent event )
{
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 @@ public void mojoStarted( ExecutionEvent event )
{
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() );
}
}