Repository: maven
Updated Branches:
  refs/heads/MNG-6352-print-version 2ed0137bb -> 8f619acd3 (forced update)


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


Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/8f619acd
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/8f619acd
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/8f619acd

Branch: refs/heads/MNG-6352-print-version
Commit: 8f619acd3a70152bdb9f3f068626bb4b48b73912
Parents: cd34b08
Author: Karl Heinz Marbaise <khmarba...@apache.org>
Authored: Sat Feb 17 18:37:36 2018 +0100
Committer: Karl Heinz Marbaise <khmarba...@apache.org>
Committed: Sat Feb 17 19:27:52 2018 +0100

----------------------------------------------------------------------
 .../apache/maven/cli/event/ExecutionEventLogger.java   | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/8f619acd/maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java
----------------------------------------------------------------------
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 d4171f7..51d00b7 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<MavenProject> 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 )

Reply via email to