[maven] branch MNG-6391 updated (24f92c2 -> 26cf168)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[maven] branch MNG-6391 updated (24f92c2 -> 26cf168)

khmarbaise
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 24f92c2  [MNG-6391] - Printout version of last built module in reactor build
     add 396f49d  [MGN-6383] - ProjectBuilder unnecessarily rebuilds modules with ci-friendly versions  o Thanks to Christoph Kunze for offering the fix.
     add f567471  improved documentation
     add 1f83d50  fixed typo + little javadoc improvements
     add d0f1efa  fixed dependency schema: model-builder depends on artifact
     add f87ba98  [MNG-6467] - Remove plugin definition from pom file which is inherited
     add 0627522  Update Jenkins build to use Maven 3.5.4 (#179)
     add e0db90a  [MNG-6473] Update Mockito to 2.21.0 (#181)
     add 01f098e  [MNG-6475] Remove unused Guava dependencies
     new 26cf168  [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   (24f92c2)
            \
             N -- N -- N   refs/heads/MNG-6391 (26cf168)

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:
 Jenkinsfile                                        |   4 +--
 apache-maven/pom.xml                               |   5 ----
 .../maven/artifact/handler/ArtifactHandler.java    |  16 +++++++++++
 maven-core/pom.xml                                 |   4 ---
 maven-core/src/site/apt/artifact-handlers.apt      |  13 +++++----
 maven-core/src/site/apt/index.apt                  |   2 +-
 maven-embedder/pom.xml                             |   4 ---
 maven-model-builder/pom.xml                        |   4 ---
 .../maven/model/building/DefaultModelBuilder.java  |   8 ++++++
 pom.xml                                            |  10 ++-----
 src/site/resources/images/maven-deps.png           | Bin 98224 -> 104566 bytes
 src/site/xdoc/index.xml                            |  32 ++++++++++-----------
 src/site/xdoc/maven-deps.odg                       | Bin 19695 -> 19887 bytes
 13 files changed, 53 insertions(+), 49 deletions(-)

Reply | Threaded
Open this post in threaded view
|

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

khmarbaise
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 26cf1681900856ddbae7dba4dd4365550a03a246
Author: Karl Heinz Marbaise <[hidden email]>
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      | 37 ++++++++++++++++++----
 1 file changed, 31 insertions(+), 6 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 00c9164..c96cda9 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,19 +141,45 @@ 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;
+                break;
+            }
+        }
+
+        return result;
+    }
+
     private void logReactorSummary( MavenSession session )
     {
+        boolean isSingleVersion = isSingleVersionedReactor( session );
+
         infoLine( '-' );
 
-        infoMain( "Reactor Summary:" );
+        StringBuilder summary = new StringBuilder( "Reactor Summary" );
+        if ( isSingleVersion )
+        {
+            summary.append( " (" );
+            summary.append( session.getTopLevelProject().getVersion() );
+            summary.append( ")" );
+        }
+        summary.append( ":" );
+        infoMain( summary.toString() );
 
         logger.info( "" );
 
         MavenExecutionResult result = session.getResult();
 
         List<MavenProject> projects = session.getProjects();
-        MavenProject lastProject = projects.get( projects.size() - 1 );
-        MavenProject topProject = session.getTopLevelProject();
 
         for ( MavenProject project : projects )
         {
@@ -162,8 +188,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,7 +266,7 @@ public class ExecutionEventLogger
 
         String wallClock = session.getRequest().getDegreeOfConcurrency() > 1 ? " (Wall Clock)" : "";
 
-        logger.info( "Total time: " + formatDuration( time ) + wallClock );
+        logger.info( "Total time:  " + formatDuration( time ) + wallClock );
 
         logger.info( "Finished at: " + formatTimestamp( finish ) );
     }