maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject git commit: [MNG-5630] improved display of forked executions: added phase or goal
Date Sat, 10 May 2014 18:53:59 GMT
Repository: maven
Updated Branches:
  refs/heads/master b52749051 -> 2cea7c6f8


[MNG-5630] improved display of forked executions: added phase or goal

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

Branch: refs/heads/master
Commit: 2cea7c6f84c7b3f4862514576dce5a6f87783f1e
Parents: b527490
Author: Hervé Boutemy <hboutemy@apache.org>
Authored: Sat May 10 20:53:56 2014 +0200
Committer: Hervé Boutemy <hboutemy@apache.org>
Committed: Sat May 10 20:53:56 2014 +0200

----------------------------------------------------------------------
 .../maven/cli/event/ExecutionEventLogger.java   | 27 ++++++++++++++++++++
 1 file changed, 27 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/2cea7c6f/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 023cfce..f48ca79 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
@@ -21,6 +21,7 @@ package org.apache.maven.cli.event;
 
 import static org.apache.maven.cli.CLIReportingUtils.formatDuration;
 import static org.apache.maven.cli.CLIReportingUtils.formatTimestamp;
+
 import org.apache.maven.execution.AbstractExecutionListener;
 import org.apache.maven.execution.BuildFailure;
 import org.apache.maven.execution.BuildSuccess;
@@ -29,7 +30,9 @@ import org.apache.maven.execution.ExecutionEvent;
 import org.apache.maven.execution.MavenExecutionResult;
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.plugin.MojoExecution;
+import org.apache.maven.plugin.descriptor.MojoDescriptor;
 import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.util.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -289,6 +292,8 @@ public class ExecutionEventLogger
 
             buffer.append( ">>> " );
             append( buffer, event.getMojoExecution() );
+            buffer.append( " > " );
+            appendForkInfo( buffer, event.getMojoExecution().getMojoDescriptor() );
             append( buffer, event.getProject() );
             buffer.append( " >>>" );
 
@@ -309,6 +314,8 @@ public class ExecutionEventLogger
 
             buffer.append( "<<< " );
             append( buffer, event.getMojoExecution() );
+            buffer.append( " < " );
+            appendForkInfo( buffer, event.getMojoExecution().getMojoDescriptor() );
             append( buffer, event.getProject() );
             buffer.append( " <<<" );
 
@@ -327,6 +334,26 @@ public class ExecutionEventLogger
         }
     }
 
+    private void appendForkInfo( StringBuilder buffer, MojoDescriptor md )
+    {
+        if ( StringUtils.isNotEmpty( md.getExecutePhase() ) )
+        {
+            // forked phase
+            if ( StringUtils.isNotEmpty( md.getExecuteLifecycle() ) )
+            {
+                buffer.append( '[' );
+                buffer.append( md.getExecuteLifecycle() );
+                buffer.append( ']' );
+            }
+            buffer.append( md.getExecutePhase() );
+        }
+        else
+        {
+            // forked goal
+            buffer.append( md.getExecuteGoal() );
+        }
+    }
+
     private void append( StringBuilder buffer, MavenProject project )
     {
         buffer.append( " @ " ).append( project.getArtifactId() );


Mime
View raw message