You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2018/02/08 22:53:32 UTC
[23/49] maven git commit: logging the module count to let the user
identify how many module are still to be executed/processed
logging the module count to let the user identify how many module are still to be executed/processed
Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/4d49d3b0
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/4d49d3b0
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/4d49d3b0
Branch: refs/heads/MNG-6255
Commit: 4d49d3b05b2e3d3a4530bb27e8cc162ab50baa7c
Parents: 5919b74
Author: Romain Manni-Bucau <rm...@gmail.com>
Authored: Thu Nov 9 09:30:47 2017 +0100
Committer: Romain Manni-Bucau <rm...@gmail.com>
Committed: Thu Nov 9 09:30:47 2017 +0100
----------------------------------------------------------------------
.../maven/cli/event/ExecutionEventLogger.java | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven/blob/4d49d3b0/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 2a089df..6cab49f 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
@@ -23,6 +23,8 @@ import static org.apache.maven.cli.CLIReportingUtils.formatDuration;
import static org.apache.maven.cli.CLIReportingUtils.formatTimestamp;
import static org.apache.maven.shared.utils.logging.MessageUtils.buffer;
+import java.util.List;
+
import org.apache.commons.lang3.Validate;
import org.apache.maven.execution.AbstractExecutionListener;
import org.apache.maven.execution.BuildFailure;
@@ -53,6 +55,9 @@ public class ExecutionEventLogger
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()
{
logger = LoggerFactory.getLogger( ExecutionEventLogger.class );
@@ -106,10 +111,13 @@ public class ExecutionEventLogger
logger.info( "" );
- for ( MavenProject project : event.getSession().getProjects() )
+ final List<MavenProject> projects = event.getSession().getProjects();
+ for ( MavenProject project : projects )
{
logger.info( project.getName() );
}
+
+ totalProjects = projects.size();
}
}
@@ -259,6 +267,16 @@ public class ExecutionEventLogger
infoMain( "Building " + event.getProject().getName() + " " + event.getProject().getVersion() );
infoLine( '-' );
+
+ if ( totalProjects > 1 )
+ {
+ int number;
+ synchronized ( this )
+ {
+ number = ++currentVisitedProjectCount;
+ }
+ infoMain( "Module " + number + "/" + totalProjects );
+ } // else what's the point
}
}