[MNG-6308] added packaging in Building message footer and summary

This commit is contained in:
Hervé Boutemy 2018-01-06 22:14:00 +01:00
parent c2e3b3e301
commit 58cf490c69
2 changed files with 9 additions and 4 deletions

View File

@ -114,7 +114,9 @@ public class ExecutionEventLogger
final List<MavenProject> projects = event.getSession().getProjects();
for ( MavenProject project : projects )
{
logger.info( project.getName() );
int len = LINE_LENGTH - project.getName().length() - project.getPackaging().length() - 2;
logger.info( project.getName() + chars( ' ', ( len > 0 ) ? len : 1 ) + '[' + project.getPackaging()
+ ']' );
}
totalProjects = projects.size();
@ -302,7 +304,10 @@ public class ExecutionEventLogger
infoMain( building + ( ( pad > 0 ) ? chars( ' ', pad ) : "" ) + progress );
}
infoLine( '-' );
// ----------[ packaging ]----------
prefix = chars( '-', Math.max( 0, ( LINE_LENGTH - project.getPackaging().length() - 4 ) / 2 ) );
suffix = chars( '-', Math.max( 0, LINE_LENGTH - project.getPackaging().length() - 4 - prefix.length() ) );
infoMain( prefix + "[ " + project.getPackaging() + " ]" + suffix );
}
}

View File

@ -73,7 +73,7 @@ public class ExecutionEventLoggerTest
inOrder.verify( logger ).info( "" );
inOrder.verify( logger ).info( "------------------< org.apache.maven:maven-embedder >-------------------" );
inOrder.verify( logger ).info( "Building Apache Maven Embedder 3.5.4-SNAPSHOT" );
inOrder.verify( logger ).info( "------------------------------------------------------------------------" );
inOrder.verify( logger ).info( "--------------------------------[ jar ]---------------------------------" );
}
@Test
@ -101,6 +101,6 @@ public class ExecutionEventLoggerTest
inOrder.verify( logger ).info( "" );
inOrder.verify( logger ).info( "--< org.apache.maven.plugins.overflow:maven-project-info-reports-plugin >--" );
inOrder.verify( logger ).info( "Building Apache Maven Project Info Reports Plugin 3.0.0-SNAPSHOT" );
inOrder.verify( logger ).info( "------------------------------------------------------------------------" );
inOrder.verify( logger ).info( "----------------------------[ maven-plugin ]----------------------------" );
}
}