/** * Method removeGoal. * * @param string */ public void removeGoal( String string ) { getGoals().remove( string ); } //-- void removeGoal( String )
/** * Method addGoal. * * @param string */ public void addGoal( String string ) { getGoals().add( string ); } //-- void addGoal( String )
protected void mergePluginExecution_Goals( PluginExecution target, PluginExecution source, boolean sourceDominant, Map<Object, Object> context ) { List<String> src = source.getGoals(); if ( !src.isEmpty() ) { List<String> tgt = target.getGoals(); List<String> merged = new ArrayList<>( tgt.size() + src.size() ); merged.addAll( tgt ); merged.addAll( src ); target.setGoals( merged ); } }
@Override protected void mergePluginExecution_Goals( PluginExecution target, PluginExecution source, boolean sourceDominant, Map<Object, Object> context ) { List<String> src = source.getGoals(); if ( !src.isEmpty() ) { List<String> tgt = target.getGoals(); Set<String> excludes = new LinkedHashSet<>( tgt ); List<String> merged = new ArrayList<>( tgt.size() + src.size() ); merged.addAll( tgt ); for ( String s : src ) { if ( !excludes.contains( s ) ) { merged.add( s ); } } target.setGoals( merged ); } }
private static void mergePluginExecutionDefinitions( PluginExecution child, PluginExecution parent ) { if ( child.getPhase() == null ) { child.setPhase( parent.getPhase() ); } List parentGoals = parent.getGoals(); List childGoals = child.getGoals(); List goals = new ArrayList(); if ( ( childGoals != null ) && !childGoals.isEmpty() ) { goals.addAll( childGoals ); } if ( parentGoals != null ) { for ( Iterator goalIterator = parentGoals.iterator(); goalIterator.hasNext(); ) { String goal = (String) goalIterator.next(); if ( !goals.contains( goal ) ) { goals.add( goal ); } } } child.setGoals( goals ); Xpp3Dom childConfiguration = (Xpp3Dom) child.getConfiguration(); Xpp3Dom parentConfiguration = (Xpp3Dom) parent.getConfiguration(); childConfiguration = Xpp3Dom.mergeXpp3Dom( childConfiguration, parentConfiguration ); child.setConfiguration( childConfiguration ); }
private static void mergePluginExecutionDefinitions( PluginExecution child, PluginExecution parent ) { if ( child.getPhase() == null ) { child.setPhase( parent.getPhase() ); } List<String> parentGoals = parent.getGoals(); List<String> childGoals = child.getGoals(); List<String> goals = new ArrayList<>(); if ( ( childGoals != null ) && !childGoals.isEmpty() ) { goals.addAll( childGoals ); } if ( parentGoals != null ) { for ( String goal : parentGoals ) { if ( !goals.contains( goal ) ) { goals.add( goal ); } } } child.setGoals( goals ); Xpp3Dom childConfiguration = (Xpp3Dom) child.getConfiguration(); Xpp3Dom parentConfiguration = (Xpp3Dom) parent.getConfiguration(); childConfiguration = Xpp3Dom.mergeXpp3Dom( childConfiguration, parentConfiguration ); child.setConfiguration( childConfiguration ); }
execution.setPhase( phase ); execution.setPriority( i - mojos.size() ); execution.getGoals().add( gs.goal );
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; }
/** * Method removeGoal. * * @param string */ public void removeGoal( String string ) { getGoals().remove( string ); } //-- void removeGoal( String )
/** * Method addGoal. * * @param string */ public void addGoal( String string ) { getGoals().add( string ); } //-- void addGoal( String )
private List<PluginExecution> getPluginExecutionsWithEnforceGoal(List<PluginExecution> executions) { List<PluginExecution> pluginExecutions = new ArrayList<>(); for (PluginExecution pluginExecution : executions) { List<String> goals = pluginExecution.getGoals(); if (goals != null && goals.contains("enforce")) { pluginExecutions.add(pluginExecution); } } return pluginExecutions; }
private List<PluginExecution> getPluginExecutionsWithEnforceGoal(List<PluginExecution> executions) { List<PluginExecution> pluginExecutions = new ArrayList<>(); for (PluginExecution pluginExecution : executions) { List<String> goals = pluginExecution.getGoals(); if (goals != null && goals.contains("enforce")) { pluginExecutions.add(pluginExecution); } } return pluginExecutions; }
protected void mergePluginExecution_Goals( PluginExecution target, PluginExecution source, boolean sourceDominant, Map<Object, Object> context ) { List<String> src = source.getGoals(); if ( !src.isEmpty() ) { List<String> tgt = target.getGoals(); List<String> merged = new ArrayList<String>( tgt.size() + src.size() ); merged.addAll( tgt ); merged.addAll( src ); target.setGoals( merged ); } }
"phase", exec.getPhase() ), exec.getConfiguration(), toArray( exec.getGoals() ) );
private boolean hasPreparePackageExecution() { for (PluginExecution execution : plugin.getExecutions()) { if (execution.getGoals().contains("prepare-package")) { return true; } } return false; } }
static Set<AggregationKey> from(Plugin plugin, PluginExecution pluginExecution) { String pluginId = plugin.getId(); return pluginExecution.getGoals().stream() .map(goal -> new AggregationKey(pluginId, goal)) .collect(Collectors.toSet()); }