Skip to content

Commit

Permalink
[FIXED JENKINS-9691] Boldify names of executed mojos for Freestyle and
Browse files Browse the repository at this point in the history
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 88d0df2
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/main/java/hudson/maven/util/ExecutionEventLogger.java
Expand Up @@ -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;
Expand Down Expand Up @@ -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() );
}
Expand Down

0 comments on commit 88d0df2

Please sign in to comment.