private void append( MessageBuilder buffer, MojoExecution me ) { buffer.mojo( me.getArtifactId() + ':' + me.getVersion() + ':' + me.getGoal() ); if ( me.getExecutionId() != null ) { buffer.a( ' ' ).strong( '(' + me.getExecutionId() + ')' ); } }
private void debugMojoExecution( MojoExecution mojoExecution ) { String mojoExecId = mojoExecution.getGroupId() + ':' + mojoExecution.getArtifactId() + ':' + mojoExecution.getVersion() + ':' + mojoExecution.getGoal() + " (" + mojoExecution.getExecutionId() + ')'; Map<String, List<MojoExecution>> forkedExecutions = mojoExecution.getForkedExecutions(); if ( !forkedExecutions.isEmpty() ) { for ( Map.Entry<String, List<MojoExecution>> fork : forkedExecutions.entrySet() ) { logger.debug( "--- init fork of " + fork.getKey() + " for " + mojoExecId + " ---" ); debugDependencyRequirements( fork.getValue() ); for ( MojoExecution forkedExecution : fork.getValue() ) { debugMojoExecution( forkedExecution ); } logger.debug( "--- exit fork of " + fork.getKey() + " for " + mojoExecId + " ---" ); } } logger.debug( "-----------------------------------------------------------------------" ); logger.debug( "Goal: " + mojoExecId ); logger.debug( "Style: " + ( mojoExecution.getMojoDescriptor().isAggregator() ? "Aggregating" : "Regular" ) ); logger.debug( "Configuration: " + mojoExecution.getConfiguration() ); }
private static String createMessage( MojoExecution execution, MavenProject project, Throwable cause ) { MessageBuilder buffer = buffer( 256 ); buffer.a( "Failed to execute goal" ); if ( execution != null ) { buffer.a( ' ' ); buffer.mojo( execution.getGroupId() + ':' + execution.getArtifactId() + ':' + execution.getVersion() + ':' + execution.getGoal() ); buffer.a( ' ' ).strong( '(' + execution.getExecutionId() + ')' ); } if ( project != null ) { buffer.a( " on project " ); buffer.project( project.getArtifactId() ); } if ( cause != null ) { buffer.a( ": " ).failure( cause.getMessage() ); } return buffer.toString(); }
@Override public void configure( MavenProject project, MojoExecution mojoExecution, boolean allowPluginLevelConfig ) { String g = mojoExecution.getGroupId(); String a = mojoExecution.getArtifactId(); Plugin plugin = findPlugin( g, a, project.getBuildPlugins() ); if ( plugin == null && project.getPluginManagement() != null ) { plugin = findPlugin( g, a, project.getPluginManagement().getPlugins() ); } if ( plugin != null ) { PluginExecution pluginExecution = findPluginExecution( mojoExecution.getExecutionId(), plugin.getExecutions() ); Xpp3Dom pomConfiguration = null; if ( pluginExecution != null ) { pomConfiguration = (Xpp3Dom) pluginExecution.getConfiguration(); } else if ( allowPluginLevelConfig ) { pomConfiguration = (Xpp3Dom) plugin.getConfiguration(); } Xpp3Dom mojoConfiguration = ( pomConfiguration != null ) ? new Xpp3Dom( pomConfiguration ) : null; mojoConfiguration = Xpp3Dom.mergeXpp3Dom( mojoExecution.getConfiguration(), mojoConfiguration ); mojoExecution.setConfiguration( mojoConfiguration ); } }
private void addExecutionIfNotContainedAlready(MojoExecution execution) { String artifact = execution.getArtifactId(); String id = execution.getExecutionId(); // We must avoid duplicates in the list for (MojoExecution exec : MOJOS) { if (exec.getArtifactId().equals(artifact) && exec.getExecutionId().equals(id)) { // Duplicate found. return; } } MOJOS.add(execution); }
public static boolean mojoExecutionForPlugin( final MojoExecution mojoExecution, final String groupId, final String artifactId, final String goal) { return groupId.equals(mojoExecution.getGroupId()) && artifactId.equals(mojoExecution.getArtifactId()) && (goal == null || goal.equals(mojoExecution.getGoal())); }
private void append( StringBuilder buffer, MojoExecution me ) { buffer.append( me.getArtifactId() ).append( ':' ).append( me.getVersion() ); buffer.append( ':' ).append( me.getGoal() ); if ( me.getExecutionId() != null ) { buffer.append( " (" ).append( me.getExecutionId() ).append( ')' ); } }
private void append( StringBuilder buffer, MojoExecution me ) { buffer.append( me.getArtifactId() ).append( ':' ).append( me.getVersion() ); buffer.append( ':' ).append( me.getGoal() ); if ( me.getExecutionId() != null ) { buffer.append( " (" ).append( me.getExecutionId() ).append( ')' ); } }
private void append( StringBuilder buffer, MojoExecution me ) { buffer.append( me.getArtifactId() ).append( ':' ).append( me.getVersion() ); buffer.append( ':' ).append( me.getGoal() ); if ( me.getExecutionId() != null ) { buffer.append( " (" ).append( me.getExecutionId() ).append( ')' ); } }
public MojoExecutionName(MojoExecution mojoExecution) { name = String.format(Locale.ENGLISH, "%s:%s (%s)", mojoExecution.getArtifactId(), mojoExecution.getGoal(), mojoExecution.getExecutionId()); }
private String mojoExec(ExecutionEvent event) { MojoExecution me = event.getMojoExecution(); return String.format("%s:%s:%s(%s)", me.getGroupId(), me.getArtifactId(), me.getVersion(), me.getExecutionId()); } }
/** * @see org.apache.maven.execution.ExecutionListener#forkFailed(org.apache.maven.execution.ExecutionEvent) */ public void forkFailed( ExecutionEvent event ) { maven3Builder.listener.getLogger().println("mojo forkFailed " + event.getMojoExecution().getGroupId() + ":" + event.getMojoExecution().getArtifactId() + ":" + event.getMojoExecution().getVersion() + "(" + event.getMojoExecution().getExecutionId() + ")"); reccordMojoFailed( event ); }
/** * @see org.apache.maven.execution.ExecutionListener#forkSucceeded(org.apache.maven.execution.ExecutionEvent) */ public void forkSucceeded( ExecutionEvent event ) { maven3Builder.listener.getLogger().println("mojo forkSucceeded " + event.getMojoExecution().getGroupId() + ":" + event.getMojoExecution().getArtifactId() + ":" + event.getMojoExecution().getVersion() + "(" + event.getMojoExecution().getExecutionId() + ")"); reccordMojoSucceeded( event ); }
/** * @see org.apache.maven.execution.ExecutionListener#mojoSkipped(org.apache.maven.execution.ExecutionEvent) */ public void mojoSkipped( ExecutionEvent event ) { maven3Builder.listener.getLogger().println("mojoSkipped " + event.getMojoExecution().getGroupId() + ":" + event.getMojoExecution().getArtifactId() + ":" + event.getMojoExecution().getVersion() + "(" + event.getMojoExecution().getExecutionId() + ")"); this.eventLogger.mojoSkipped( event ); }
/** * @see org.apache.maven.execution.ExecutionListener#forkStarted(org.apache.maven.execution.ExecutionEvent) */ public void forkStarted( ExecutionEvent event ) { maven3Builder.listener.getLogger().println("mojo forkStarted " + event.getMojoExecution().getGroupId() + ":" + event.getMojoExecution().getArtifactId() + ":" + event.getMojoExecution().getVersion() + "(" + event.getMojoExecution().getExecutionId() + ")"); reccordMojoStarted( event ); }
private void append( MessageBuilder buffer, MojoExecution me ) { buffer.mojo( me.getArtifactId() + ':' + me.getVersion() + ':' + me.getGoal() ); if ( me.getExecutionId() != null ) { buffer.a( ' ' ).strong( '(' + me.getExecutionId() + ')' ); } }
/** * @see org.apache.maven.execution.ExecutionListener#mojoFailed(org.apache.maven.execution.ExecutionEvent) */ public void mojoFailed( ExecutionEvent event ) { maven3Builder.listener.getLogger().println("mojoFailed " + event.getMojoExecution().getGroupId() + ":" + event.getMojoExecution().getArtifactId() + ":" + event.getMojoExecution().getVersion() + "(" + event.getMojoExecution().getExecutionId() + ")"); reccordMojoFailed( event ); this.eventLogger.mojoFailed( event ); }
private void recordMojoStarted( final ExecutionEvent event ) { if( ExecutionEvent.Type.MojoStarted.equals(event.getType()) ) { MojoExecution mojoExecution = event.getMojoExecution(); ProjectLogger.log(event.getProject(), "mojo started - " + mojoExecution.getLifecyclePhase() + " " + mojoExecution.getArtifactId() + " " + mojoExecution.getExecutionId() ); // There are none. //log.debug("Mojo Plugin deps: {}", mojoExecution.getPlugin().getDependencies()); } }
private void recordMojoStarted( final ExecutionEvent event ) { if( ExecutionEvent.Type.MojoStarted.equals(event.getType()) ) { MojoExecution mojoExecution = event.getMojoExecution(); ProjectLogger.log(event.getProject(), "mojo started - " + mojoExecution.getLifecyclePhase() + " " + mojoExecution.getArtifactId() + " " + mojoExecution.getExecutionId() ); // There are none. //log.debug("Mojo Plugin deps: {}", mojoExecution.getPlugin().getDependencies()); } }
private void recordMojoStarted( final ExecutionEvent event ) { if( ExecutionEvent.Type.MojoStarted.equals(event.getType()) ) { MojoExecution mojoExecution = event.getMojoExecution(); ProjectLogger.log(event.getProject(), "mojo started - " + mojoExecution.getLifecyclePhase() + " " + mojoExecution.getArtifactId() + " " + mojoExecution.getExecutionId() ); // There are none. //log.debug("Mojo Plugin deps: {}", mojoExecution.getPlugin().getDependencies()); } }