Repository: maven
Updated Branches:
  refs/heads/MNG-6352-print-version 2de92a1dc -> 334518710 (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/33451871
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/33451871
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/33451871

Branch: refs/heads/MNG-6352-print-version
Commit: 334518710b90bf660ce775d964e838fdf1eba3c5
Parents: cd34b08
Author: Karl Heinz Marbaise <khmarba...@apache.org>
Authored: Thu Feb 8 20:47:25 2018 +0100
Committer: Karl Heinz Marbaise <khmarba...@apache.org>
Committed: Fri Feb 16 20:04:05 2018 +0100

----------------------------------------------------------------------
 .../maven/cli/event/ExecutionEventLogger.java   | 39 ++++++++++++++++----
 1 file changed, 31 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/33451871/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..5fa1ced 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
@@ -52,10 +52,13 @@ public class ExecutionEventLogger
     private final Logger logger;
 
     private static final int LINE_LENGTH = 72;
+
     private static final int MAX_PADDED_BUILD_TIME_DURATION_LENGTH = 9;
+
     private static final int MAX_PROJECT_NAME_LENGTH = 52;
 
     private int totalProjects;
+
     private volatile int currentVisitedProjectCount;
 
     public ExecutionEventLogger()
@@ -138,6 +141,7 @@ public class ExecutionEventLogger
             logStats( event.getSession() );
 
             infoLine( '-' );
+
         }
     }
 
@@ -151,6 +155,7 @@ public class ExecutionEventLogger
 
         MavenExecutionResult result = session.getResult();
 
+        MavenProject topProject = session.getTopLevelProject();
         for ( MavenProject project : session.getProjects() )
         {
             StringBuilder buffer = new StringBuilder( 128 );
@@ -158,6 +163,12 @@ public class ExecutionEventLogger
             buffer.append( project.getName() );
             buffer.append( ' ' );
 
+            if ( topProject.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 )
@@ -261,8 +272,8 @@ public class ExecutionEventLogger
 
             // -------< groupId:artifactId >-------
             String projectKey = project.getGroupId() + ':' + 
project.getArtifactId();
-            
-            final String preHeader  = "--< ";
+
+            final String preHeader = "--< ";
             final String postHeader = " >--";
 
             final int headerLen = preHeader.length() + projectKey.length() + 
postHeader.length();
@@ -274,7 +285,7 @@ public class ExecutionEventLogger
 
             logger.info( buffer().strong( prefix ).project( projectKey 
).strong( suffix ).toString() );
 
-            // Building Project Name Version    [i/n]
+            // Building Project Name Version [i/n]
             String building = "Building " + event.getProject().getName() + " " 
+ event.getProject().getVersion();
 
             if ( totalProjects <= 1 )
@@ -314,7 +325,9 @@ public class ExecutionEventLogger
     }
 
     /**
-     * <pre>--- mojo-artifactId:version:goal (mojo-executionId) @ 
project-artifactId ---</pre>
+     * <pre>
+     * --- mojo-artifactId:version:goal (mojo-executionId) @ 
project-artifactId ---
+     * </pre>
      */
     @Override
     public void mojoStarted( ExecutionEvent event )
@@ -334,8 +347,13 @@ public class ExecutionEventLogger
 
     // CHECKSTYLE_OFF: LineLength
     /**
-     * <pre>&gt;&gt;&gt; mojo-artifactId:version:goal (mojo-executionId) &gt; 
:forked-goal @ project-artifactId &gt;&gt;&gt;</pre>
-     * <pre>&gt;&gt;&gt; mojo-artifactId:version:goal (mojo-executionId) &gt; 
[lifecycle]phase @ project-artifactId &gt;&gt;&gt;</pre>
+     * <pre>
+     * &gt;&gt;&gt; mojo-artifactId:version:goal (mojo-executionId) &gt; 
:forked-goal @ project-artifactId &gt;&gt;&gt;
+     * </pre>
+     * 
+     * <pre>
+     * &gt;&gt;&gt; mojo-artifactId:version:goal (mojo-executionId) &gt; 
[lifecycle]phase @ project-artifactId &gt;&gt;&gt;
+     * </pre>
      */
     // CHECKSTYLE_ON: LineLength
     @Override
@@ -358,8 +376,13 @@ public class ExecutionEventLogger
 
     // CHECKSTYLE_OFF: LineLength
     /**
-     * <pre>&lt;&lt;&lt; mojo-artifactId:version:goal (mojo-executionId) &lt; 
:forked-goal @ project-artifactId &lt;&lt;&lt;</pre>
-     * <pre>&lt;&lt;&lt; mojo-artifactId:version:goal (mojo-executionId) &lt; 
[lifecycle]phase @ project-artifactId &lt;&lt;&lt;</pre>
+     * <pre>
+     * &lt;&lt;&lt; mojo-artifactId:version:goal (mojo-executionId) &lt; 
:forked-goal @ project-artifactId &lt;&lt;&lt;
+     * </pre>
+     * 
+     * <pre>
+     * &lt;&lt;&lt; mojo-artifactId:version:goal (mojo-executionId) &lt; 
[lifecycle]phase @ project-artifactId &lt;&lt;&lt;
+     * </pre>
      */
     // CHECKSTYLE_ON: LineLength
     @Override

Reply via email to