@Override public void mojoSkipped( ExecutionEvent event ) { if ( logger.isWarnEnabled() ) { logger.warn( "Goal " + event.getMojoExecution().getGoal() + " requires online mode for execution but Maven is currently offline, skipping" ); } }
public void releaseMojo( Object mojo, MojoExecution mojoExecution ) { if ( mojo != null ) { try { container.release( mojo ); } catch ( ComponentLifecycleException e ) { String goalExecId = mojoExecution.getGoal(); if ( mojoExecution.getExecutionId() != null ) { goalExecId += " {execution: " + mojoExecution.getExecutionId() + "}"; } logger.debug( "Error releasing mojo for " + goalExecId, e ); } } }
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 void append( MessageBuilder buffer, MojoExecution me ) { buffer.mojo( me.getArtifactId() + ':' + me.getVersion() + ':' + me.getGoal() ); if ( me.getExecutionId() != null ) { buffer.a( ' ' ).strong( '(' + me.getExecutionId() + ')' ); } }
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(); }
pluginManager.getMojoDescriptor( forkedExecution.getPlugin(), forkedExecution.getGoal(), project.getRemotePluginRepositories(), session.getRepositorySession() );
@Override public void setupMojoExecution( MavenSession session, MavenProject project, MojoExecution mojoExecution ) throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, MojoNotFoundException, InvalidPluginDescriptorException, NoPluginFoundForPrefixException, LifecyclePhaseNotFoundException, LifecycleNotFoundException, PluginVersionResolutionException { MojoDescriptor mojoDescriptor = mojoExecution.getMojoDescriptor(); if ( mojoDescriptor == null ) { mojoDescriptor = pluginManager.getMojoDescriptor( mojoExecution.getPlugin(), mojoExecution.getGoal(), project.getRemotePluginRepositories(), session.getRepositorySession() ); mojoExecution.setMojoDescriptor( mojoDescriptor ); } mojoExecutionConfigurator( mojoExecution ).configure( project, mojoExecution, MojoExecution.Source.CLI.equals( mojoExecution.getSource() ) ); finalizeMojoConfiguration( mojoExecution ); calculateForkedExecutions( mojoExecution, session, project, new HashSet<MojoDescriptor>() ); }
@Override public void mojoSkipped( ExecutionEvent event ) { if ( logger.isWarnEnabled() ) { logger.warn( "Goal " + event.getMojoExecution().getGoal() + " requires online mode for execution but Maven is currently offline, skipping" ); } }
@Override public void mojoSkipped( ExecutionEvent event ) { if ( logger.isWarnEnabled() ) { logger.warn( "Goal " + event.getMojoExecution().getGoal() + " requires online mode for execution but Maven is currently offline, skipping" ); } }
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()); }
/** * Returns conventional MojoExecution identifier used by incremental build tools. */ public String getExecutionId(MojoExecution execution) { PluginDescriptor pluginDescriptor = execution.getMojoDescriptor().getPluginDescriptor(); StringBuilder builderId = new StringBuilder(); builderId.append(pluginDescriptor.getGroupId()).append('_') .append(pluginDescriptor.getArtifactId()); builderId.append('_').append(execution.getGoal()).append('_') .append(execution.getExecutionId()); return builderId.toString(); }
public MojoExecutor(MojoExecution execution, MavenProject project, MavenSession session, BuildPluginManager buildPluginManager) { this.build = buildPluginManager; this.project = project; this.session = session; this.plugin = execution.getPlugin(); configuration = execution.getConfiguration(); goal = execution.getGoal(); }
protected <T> T getParameterValue(final MojoExecution execution, final ConfigurationContainer configurationContainer, final String parameter, final Class<T> asType) throws CoreException { return maven.getMojoParameterValue(mavenProject, parameter, asType, execution.getPlugin(), configurationContainer, execution.getGoal(), monitor); }
@Override public void mojoSkipped( ExecutionEvent event ) { if ( logger.isWarnEnabled() ) { logger.warn( "Goal " + event.getMojoExecution().getGoal() + " requires online mode for execution but Maven is currently offline, skipping" ); } }
protected <T> T getParameterValue(String parameter, Class<T> asType, MavenSession session, MojoExecution mojoExecution) throws CoreException { PluginExecution execution = new PluginExecution(); execution.setConfiguration(mojoExecution.getConfiguration()); return maven.getMojoParameterValue(parameter, asType, session, mojoExecution.getPlugin(), execution, mojoExecution.getGoal()); }
private void append( MessageBuilder buffer, MojoExecution me ) { buffer.mojo( me.getArtifactId() + ':' + me.getVersion() + ':' + me.getGoal() ); if ( me.getExecutionId() != null ) { buffer.a( ' ' ).strong( '(' + me.getExecutionId() + ')' ); } }