Skip to content
Permalink
Browse files
[FIXED JENKINS-9691] Boldify names of executed mojos for Freestyle and
Maven2/3 jobs using Maven3 in console output.
With Maven3 the output format for mojos has changed:
- Add a new Maven3MojoNote and use it in MavenConsoleAnnotator.
- This is sufficient for Freestyle jobs running Maven2 or 3 and Maven2/3
  jobs running Maven 2.
- Maven2/3 jobs running Maven 3 are using ExecutionEventLogger for
  printing start of mojo execution to console.

Originally-Committed-As: 6ae77ed34a29fb9200371a57603dc95d8df1ffb9
  • Loading branch information
mfriedenhagen committed May 16, 2011
1 parent 2247758 commit 88d0df2f04f6d3a79cc9acd8d5d1cb6d9f19e6ff
Showing with 11 additions and 3 deletions.
  1. +11 −3 src/main/java/hudson/maven/util/ExecutionEventLogger.java
@@ -19,6 +19,9 @@
* under the License.
*/

import hudson.tasks._maven.Maven3MojoNote;

import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
@@ -261,13 +264,18 @@ public void mojoStarted( ExecutionEvent event )
{
if ( logger.isInfoEnabled() )
{
StringBuilder buffer = new StringBuilder( 128 );

final Maven3MojoNote note = new Maven3MojoNote();
final StringBuilder buffer = new StringBuilder( 128 );
try {
buffer.append( note.encode() );
} catch ( IOException e ) {
// As we use only memory buffers this should not happen, ever.
throw new RuntimeException( "Could not encode note?", e );
}
buffer.append( "--- " );
append( buffer, event.getMojoExecution() );
append( buffer, event.getProject() );
buffer.append( " ---" );

logger.info( "" );
logger.info( buffer.toString() );
}

0 comments on commit 88d0df2

Please sign in to comment.