@Override protected Object getPluginExecutionKey( PluginExecution pluginExecution ) { return pluginExecution.getId(); }
@Override public String toString() { return getId(); }
private PluginExecution findPluginExecution( String executionId, Collection<PluginExecution> executions ) { if ( StringUtils.isNotEmpty( executionId ) ) { for ( PluginExecution execution : executions ) { if ( executionId.equals( execution.getId() ) ) { return execution; } } } return null; }
private String getExecutionId( Plugin plugin, String goal ) { Set<String> existingIds = new HashSet<>(); for ( PluginExecution execution : plugin.getExecutions() ) { existingIds.add( execution.getId() ); } String base = "default-" + goal; String id = base; for ( int index = 1; existingIds.contains( id ); index++ ) { id = base + '-' + index; } return id; }
protected void mergePluginExecution_Id( PluginExecution target, PluginExecution source, boolean sourceDominant, Map<Object, Object> context ) { String src = source.getId(); if ( src != null ) { if ( sourceDominant || target.getId() == null ) { target.setId( src ); target.setLocation( "id", source.getLocation( "id" ) ); } } }
/** * @return a Map of executions field with <code>PluginExecution#getId()</code> as key * @see org.apache.maven.model.PluginExecution#getId() */ public java.util.Map<String, PluginExecution> getExecutionsAsMap() { if ( executionMap == null ) { executionMap = new java.util.LinkedHashMap<String, PluginExecution>(); if ( getExecutions() != null ) { for ( java.util.Iterator<PluginExecution> i = getExecutions().iterator(); i.hasNext(); ) { PluginExecution exec = (PluginExecution) i.next(); if ( executionMap.containsKey( exec.getId() ) ) { throw new IllegalStateException( "You cannot have two plugin executions with the same (or missing) <id/> elements.\nOffending execution\n\nId: \'" + exec.getId() + "\'\nPlugin:\'" + getKey() + "\'\n\n" ); } executionMap.put( exec.getId(), exec ); } } } return executionMap; }
private void mergeDeterministicPluginElements( List iPlugins, List dPlugins ) { if ( dPlugins != null ) { for ( int i = 0; i < dPlugins.size(); i++ ) { Plugin dPlugin = (Plugin) dPlugins.get( i ); Plugin iPlugin = (Plugin) iPlugins.get( i ); dPlugin.setGroupId( iPlugin.getGroupId() ); dPlugin.setArtifactId( iPlugin.getArtifactId() ); dPlugin.setVersion( iPlugin.getVersion() ); dPlugin.setDependencies( iPlugin.getDependencies() ); List dExecutions = dPlugin.getExecutions(); if ( dExecutions != null ) { List iExecutions = iPlugin.getExecutions(); for ( int j = 0; j < dExecutions.size(); j++ ) { PluginExecution dExec = (PluginExecution) dExecutions.get( j ); PluginExecution iExec = (PluginExecution) iExecutions.get( j ); dExec.setId( iExec.getId() ); } } } } }
if ( pluginExecutionId.equals( execution.getId() ) )
MojoExecution mojoExecution = new MojoExecution( plugin, goal, execution.getId() ); mojoExecution.setLifecyclePhase( execution.getPhase() ); addMojoExecution( phaseBindings, mojoExecution, execution.getPriority() ); if ( phaseBindings != null ) MojoExecution mojoExecution = new MojoExecution( mojoDescriptor, execution.getId() ); mojoExecution.setLifecyclePhase( mojoDescriptor.getPhase() ); addMojoExecution( phaseBindings, mojoExecution, execution.getPriority() );
public static PluginExecution clonePluginExecution( PluginExecution src ) { PluginExecution result = null; if ( src != null ) { result = new PluginExecution(); result.setId( src.getId() ); result.setGoals( cloneListOfStrings( src.getGoals() ) ); result.setConfiguration( cloneConfiguration( src.getConfiguration() ) ); result.setInherited( src.getInherited() ); result.setPhase( src.getPhase() ); } return result; }
@Override public String toString() { return getId(); }
private PluginExecution findPluginExecution(String executionId, Collection<PluginExecution> executions) { if (StringUtils.isNotEmpty(executionId)) { for (PluginExecution execution : executions) { if (executionId.equals(execution.getId())) { return execution; } } } return null; } }
private PluginExecution findPluginExecution(String executionId, Collection<PluginExecution> executions) { if (StringUtils.isNotEmpty(executionId)) { for (PluginExecution execution : executions) { if (executionId.equals(execution.getId())) { return execution; } } } return null; } }