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 ); }
modelExecution.setGoals( goals );
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; }
pluginExecution.setGoals( goals ); while ( parser.nextTag() == XmlPullParser.START_TAG )
@Override public boolean onHandleNodeAttributes(FactoryBuilderSupport builder, Object current, Map attrs) { PluginExecution node = (PluginExecution) current; // Custom handling for 'goal' and 'goals' attributes if (attrs.containsKey("goal")) { Object value = attrs.get("goal"); node.setGoals(Collections.singletonList(String.valueOf(value))); attrs.remove("goal"); } else if (attrs.containsKey("goals")) { Object value = attrs.get("goals"); if (value instanceof String) { node.setGoals(Collections.singletonList(String.valueOf(value))); } else if (value instanceof List) { node.setGoals((List) value); } attrs.remove("goals"); } return true; } }
pluginExecution.setGoals( goals ); InputLocation _locations; _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
public default WrapperPluginExecutionBuilder execution(PluginExecutionNamedValue... namedValues) { PluginExecution execution = new PluginExecution(); Map<String, String> map = new HashMap<>(); for (PluginExecutionNamedValue kvp : namedValues) { if (kvp instanceof ConfigurationNamedValue) { execution.setConfiguration(((ConfigurationNamedValue) kvp).getConfiguration()); } else if (kvp instanceof PluginExecutionGoalsNamedValue) { execution.setGoals(((PluginExecutionGoalsNamedValue)kvp).getGoals()); } else { map.put(kvp.name(), kvp.value()); NamedValueProcessor.mapToObject(execution, map); } } return new WrapperPluginExecutionBuilder(execution); }
public PluginExecution get() { PluginExecution execution = new PluginExecution(); if (configuration != null) { execution.setConfiguration(configuration); } if (goals != null) { execution.setGoals(goals); } execution.setId(id); execution.setInherited(inherited); execution.setPhase(phase); execution.setPriority(priority); return execution; }
pluginExecution.setGoals( goals ); while ( parser.nextTag() == XmlPullParser.START_TAG )
execution.setGoals(goals);
@Override public boolean onHandleNodeAttributes(FactoryBuilderSupport builder, Object current, Map attrs) { PluginExecution node = (PluginExecution) current; // Custom handling for 'goal' and 'goals' attributes if (attrs.containsKey("goal")) { Object value = attrs.get("goal"); node.setGoals(Collections.singletonList(String.valueOf(value))); attrs.remove("goal"); } else if (attrs.containsKey("goals")) { Object value = attrs.get("goals"); if (value instanceof String) { node.setGoals(Collections.singletonList(String.valueOf(value))); } else if (value instanceof List) { node.setGoals((List) value); } attrs.remove("goals"); } return true; } }
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 ); } }
@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 void addEnforcerPluginExecution(MavenProject mavenProject, Xpp3Dom configuration) { List<String> goals = new ArrayList<String>(); goals.add("enforce"); PluginExecution pe = new PluginExecution(); pe.setId("enforce-" + mavenProject.getPackaging()); pe.setGoals(goals); pe.setConfiguration(configuration); if (pe != null) { this.plugin.getExecutions().add(pe); } }
private List<PluginExecution> transformExecutions(final MavenPlugin mavenPlugin) { List<PluginExecution> executions = new ArrayList<PluginExecution>(); for (Execution execution : mavenPlugin.listExecutions()) { PluginExecution pluginExecution = new PluginExecution(); pluginExecution.setId(execution.getId()); pluginExecution.setPhase(execution.getPhase()); pluginExecution.setGoals(execution.getGoals()); pluginExecution.setConfiguration(parseConfig(execution.getConfig())); executions.add(pluginExecution); } return executions; }
private PluginExecution clone(PluginExecution execution) { PluginExecution clonedExecution = new PluginExecution(); clonedExecution.setId(execution.getId() + "-snapshot"); clonedExecution.setGoals(execution.getGoals()); clonedExecution.setPhase(execution.getPhase()); clonedExecution.setPriority(execution.getPriority()); return clonedExecution; }
exec.setGoals(Collections.singletonList("directory-single")); //NOI18N if (exec.getConfiguration() == null) { exec.setConfiguration(new Xpp3Dom(CONFIGURATION_EL));