From 8f619acd3a70152bdb9f3f068626bb4b48b73912 Mon Sep 17 00:00:00 2001 From: Karl Heinz Marbaise Date: Sat, 17 Feb 2018 18:37:36 +0100 Subject: [PATCH] [MNG-6352] - Printout version information at the end of the build --- .../maven/cli/event/ExecutionEventLogger.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 d4171f7252..51d00b7850 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 @@ -151,13 +151,24 @@ public class ExecutionEventLogger MavenExecutionResult result = session.getResult(); - for ( MavenProject project : session.getProjects() ) + List projects = session.getProjects(); + MavenProject lastProject = projects.get( projects.size() - 1 ); + MavenProject topProject = session.getTopLevelProject(); + + for ( MavenProject project : projects ) { StringBuilder buffer = new StringBuilder( 128 ); buffer.append( project.getName() ); 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 ) { while ( buffer.length() < MAX_PROJECT_NAME_LENGTH )