[MNG-6352] - Printout version information at the end of the build

This commit is contained in:
Karl Heinz Marbaise 2018-02-17 18:37:36 +01:00
parent cd34b08df1
commit 8f619acd3a
1 changed files with 12 additions and 1 deletions

View File

@ -151,13 +151,24 @@ public class ExecutionEventLogger
MavenExecutionResult result = session.getResult(); MavenExecutionResult result = session.getResult();
for ( MavenProject project : session.getProjects() ) List<MavenProject> projects = session.getProjects();
MavenProject lastProject = projects.get( projects.size() - 1 );
MavenProject topProject = session.getTopLevelProject();
for ( MavenProject project : projects )
{ {
StringBuilder buffer = new StringBuilder( 128 ); StringBuilder buffer = new StringBuilder( 128 );
buffer.append( project.getName() ); buffer.append( project.getName() );
buffer.append( ' ' ); buffer.append( ' ' );
if ( topProject.equals( project ) || lastProject.equals( project )
|| !topProject.getVersion().equals( project.getVersion() ) )
{
buffer.append( project.getVersion() );
buffer.append( ' ' );
}
if ( buffer.length() <= MAX_PROJECT_NAME_LENGTH ) if ( buffer.length() <= MAX_PROJECT_NAME_LENGTH )
{ {
while ( buffer.length() < MAX_PROJECT_NAME_LENGTH ) while ( buffer.length() < MAX_PROJECT_NAME_LENGTH )