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 )