You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2018/04/11 17:52:54 UTC

[maven] branch MNG-6391 updated (711217c -> 4a7a580)

This is an automated email from the ASF dual-hosted git repository.

khmarbaise pushed a change to branch MNG-6391
in repository https://gitbox.apache.org/repos/asf/maven.git.


 discard 711217c  [MNG-6391] - Printout version of last built module in reactor build
     new 4a7a580  [MNG-6391] - Printout version of last built module in reactor build

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (711217c)
            \
             N -- N -- N   refs/heads/MNG-6391 (4a7a580)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:

-- 
To stop receiving notification emails like this one, please contact
khmarbaise@apache.org.

[maven] 01/01: [MNG-6391] - Printout version of last built module in reactor build

Posted by kh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

khmarbaise pushed a commit to branch MNG-6391
in repository https://gitbox.apache.org/repos/asf/maven.git

commit 4a7a580280a9d759b4d456c48e64562a8c94a240
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Wed Apr 11 19:42:38 2018 +0200

    [MNG-6391] - Printout version of last built module in reactor build
---
 .../maven/cli/event/ExecutionEventLogger.java      | 30 +++++++++++++++++++---
 1 file changed, 26 insertions(+), 4 deletions(-)

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 51d00b7..e0dc569 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
@@ -141,6 +141,23 @@ public class ExecutionEventLogger
         }
     }
 
+    private boolean isSingleVersionedReactor( MavenSession session )
+    {
+        boolean result = true;
+
+        MavenProject topProject = session.getTopLevelProject();
+        List<MavenProject> sortedProjects = session.getProjectDependencyGraph().getSortedProjects();
+        for ( MavenProject mavenProject : sortedProjects )
+        {
+            if ( !topProject.getVersion().equals( mavenProject.getVersion() ) )
+            {
+                result = false;
+            }
+        }
+
+        return result;
+    }
+
     private void logReactorSummary( MavenSession session )
     {
         infoLine( '-' );
@@ -152,9 +169,8 @@ public class ExecutionEventLogger
         MavenExecutionResult result = session.getResult();
 
         List<MavenProject> projects = session.getProjects();
-        MavenProject lastProject = projects.get( projects.size() - 1 );
-        MavenProject topProject = session.getTopLevelProject();
 
+        boolean isSingleVersion = isSingleVersionedReactor( session );
         for ( MavenProject project : projects )
         {
             StringBuilder buffer = new StringBuilder( 128 );
@@ -162,8 +178,7 @@ public class ExecutionEventLogger
             buffer.append( project.getName() );
             buffer.append( ' ' );
 
-            if ( topProject.equals( project ) || lastProject.equals( project )
-                || !topProject.getVersion().equals( project.getVersion() ) )
+            if ( !isSingleVersion )
             {
                 buffer.append( project.getVersion() );
                 buffer.append( ' ' );
@@ -241,6 +256,13 @@ public class ExecutionEventLogger
 
         String wallClock = session.getRequest().getDegreeOfConcurrency() > 1 ? " (Wall Clock)" : "";
 
+        boolean isSingleVersion = isSingleVersionedReactor( session );
+
+        if ( isSingleVersion )
+        {
+            logger.info( "Version: " + session.getTopLevelProject().getVersion() );
+        }
+
         logger.info( "Total time: " + formatDuration( time ) + wallClock );
 
         logger.info( "Finished at: " + formatTimestamp( finish ) );

-- 
To stop receiving notification emails like this one, please contact
khmarbaise@apache.org.