protected void mergePlugin_Executions( Plugin target, Plugin source, boolean sourceDominant, Map<Object, Object> context ) { List<PluginExecution> src = source.getExecutions(); if ( !src.isEmpty() ) { List<PluginExecution> tgt = target.getExecutions(); Map<Object, PluginExecution> merged = new LinkedHashMap<>( ( src.size() + tgt.size() ) * 2 ); for ( PluginExecution element : tgt ) { Object key = getPluginExecutionKey( element ); merged.put( key, element ); } for ( PluginExecution element : src ) { Object key = getPluginExecutionKey( element ); if ( sourceDominant || !merged.containsKey( key ) ) { merged.put( key, element ); } } target.setExecutions( new ArrayList<>( merged.values() ) ); } }
target.setExecutions( new ArrayList<>( merged.values() ) );
@Override protected void mergePlugin_Executions( Plugin target, Plugin source, boolean sourceDominant, Map<Object, Object> context ) { List<PluginExecution> src = source.getExecutions(); if ( !src.isEmpty() ) { List<PluginExecution> tgt = target.getExecutions(); Map<Object, PluginExecution> merged = new LinkedHashMap<>( ( src.size() + tgt.size() ) * 2 ); for ( PluginExecution element : src ) { Object key = getPluginExecutionKey( element ); merged.put( key, element.clone() ); } for ( PluginExecution element : tgt ) { Object key = getPluginExecutionKey( element ); PluginExecution existing = merged.get( key ); if ( existing != null ) { mergePluginExecution( element, existing, sourceDominant, context ); } merged.put( key, element ); } target.setExecutions( new ArrayList<>( merged.values() ) ); } } }
target.setExecutions( new ArrayList<>( merged.values() ) );
modelPlugin.setExecutions( profilePlugin.getExecutions() ); modelPlugin.setExecutions( new ArrayList( executions.values() ) );
child.setExecutions(mergedExecutions);
child.setExecutions( mergedExecutions );
plugin.setExecutions( executions ); while ( parser.nextTag() == XmlPullParser.START_TAG )
public static Plugin clonePlugin( Plugin src ) { Plugin result = null; if ( src != null ) { result = new Plugin(); result.setArtifactId( src.getArtifactId() ); result.setConfiguration( cloneConfiguration( src.getConfiguration() ) ); result.setDependencies( cloneList( src.getDependencies(), DEPENDENCY_CLONER ) ); result.setExecutions( cloneList( src.getExecutions(), PLUGIN_EXECUTION_CLONER ) ); result.setExtensions( src.isExtensions() ); result.setGroupId( src.getGroupId() ); result.setInherited( src.getInherited() ); result.setVersion( src.getVersion() ); } return result; }
public PluginBuilder executions(PluginExecutionBuilder... builders) { if (builders != null) { for (PluginExecutionBuilder executionBuilder : Arrays.asList(builders)) { if (plugin.getExecutions() == null) { plugin.setExecutions(new ArrayList<>()); } plugin.addExecution((executionBuilder.get())); } } return this; }
plugin.setExecutions( executions ); while ( parser.nextTag() == XmlPullParser.START_TAG )
public default WrapperPluginBuilder plugin(PluginNamedValue... namedValues) { Plugin plugin = new Plugin(); Map<String, String> map = new HashMap<>(); for (PluginNamedValue kvp : namedValues) { if (kvp instanceof ConfigurationNamedValue) { plugin.setConfiguration(((ConfigurationNamedValue)kvp).getConfiguration()); } else if (kvp instanceof ExecutionsNamedValue) { plugin.setExecutions(((ExecutionsNamedValue)kvp).getExecutions()); } else if (kvp instanceof DependenciesNamedValue) { plugin.setDependencies(((DependenciesNamedValue)kvp).getDependencies()); } else { map.put(kvp.name(), kvp.value()); NamedValueProcessor.mapToObject(plugin, map); } } return new WrapperPluginBuilder(plugin); }
public void setExecutions(List<PluginExecution> executions) { plugin.setExecutions(executions); }
plugin.setExecutions( executions ); while ( parser.nextTag() == XmlPullParser.START_TAG )
protected void mergePlugin_Executions( Plugin target, Plugin source, boolean sourceDominant, Map<Object, Object> context ) { List<PluginExecution> src = source.getExecutions(); if ( !src.isEmpty() ) { List<PluginExecution> tgt = target.getExecutions(); Map<Object, PluginExecution> merged = new LinkedHashMap<Object, PluginExecution>( ( src.size() + tgt.size() ) * 2 ); for ( PluginExecution element : tgt ) { Object key = getPluginExecutionKey( element ); merged.put( key, element ); } for ( PluginExecution element : src ) { Object key = getPluginExecutionKey( element ); if ( sourceDominant || !merged.containsKey( key ) ) { merged.put( key, element ); } } target.setExecutions( new ArrayList<PluginExecution>( merged.values() ) ); } }
target.setExecutions( new ArrayList<>( merged.values() ) );
@Override protected void mergePlugin_Executions( Plugin target, Plugin source, boolean sourceDominant, Map<Object, Object> context ) { List<PluginExecution> src = source.getExecutions(); if ( !src.isEmpty() ) { List<PluginExecution> tgt = target.getExecutions(); Map<Object, PluginExecution> merged = new LinkedHashMap<>( ( src.size() + tgt.size() ) * 2 ); for ( PluginExecution element : src ) { Object key = getPluginExecutionKey( element ); merged.put( key, element.clone() ); } for ( PluginExecution element : tgt ) { Object key = getPluginExecutionKey( element ); PluginExecution existing = merged.get( key ); if ( existing != null ) { mergePluginExecution( element, existing, sourceDominant, context ); } merged.put( key, element ); } target.setExecutions( new ArrayList<>( merged.values() ) ); } } }
target.setExecutions( new ArrayList<>( merged.values() ) );
public static Plugin getNewCompilerPlugin(Map<ConfigurationKey, String> conf) { Plugin newCompilerPlugin = new Plugin(); newCompilerPlugin.setGroupId(conf.get(ConfigurationKey.TAKARI_COMPILER_PLUGIN_GROUP)); newCompilerPlugin.setArtifactId(conf.get(ConfigurationKey.TAKARI_COMPILER_PLUGIN_ARTIFACT)); newCompilerPlugin.setVersion(conf.get(ConfigurationKey.TAKARI_COMPILER_PLUGIN_VERSION)); Xpp3Dom compilerId = new Xpp3Dom(MavenConfig.MAVEN_COMPILER_ID); compilerId.setValue(conf.get(ConfigurationKey.COMPILER)); Xpp3Dom sourceVersion = new Xpp3Dom(MavenConfig.MAVEN_SOURCE); sourceVersion.setValue(conf.get(ConfigurationKey.SOURCE_VERSION)); Xpp3Dom targetVersion = new Xpp3Dom(MavenConfig.MAVEN_TARGET); targetVersion.setValue(conf.get(ConfigurationKey.TARGET_VERSION)); Xpp3Dom failOnError = new Xpp3Dom(MavenConfig.FAIL_ON_ERROR); failOnError.setValue(conf.get(ConfigurationKey.FAIL_ON_ERROR)); Xpp3Dom configuration = new Xpp3Dom(MavenConfig.MAVEN_PLUGIN_CONFIGURATION); configuration.addChild(compilerId); configuration.addChild(sourceVersion); configuration.addChild(targetVersion); configuration.addChild(failOnError); newCompilerPlugin.setConfiguration(configuration); PluginExecution execution = new PluginExecution(); execution.setId(MavenCLIArgs.DEFAULT_COMPILE); execution.setGoals(Arrays.asList(MavenCLIArgs.COMPILE)); execution.setPhase(MavenCLIArgs.COMPILE); newCompilerPlugin.setExecutions(Arrays.asList(execution)); return newCompilerPlugin; }
public static void disableMavenCompilerAlreadyPresent(Plugin plugin) { Xpp3Dom skipMain = new Xpp3Dom(MavenConfig.MAVEN_SKIP_MAIN); skipMain.setValue(TRUE); Xpp3Dom skip = new Xpp3Dom(MavenConfig.MAVEN_SKIP); skip.setValue(TRUE); Xpp3Dom configuration = new Xpp3Dom(MavenConfig.MAVEN_PLUGIN_CONFIGURATION); configuration.addChild(skipMain); configuration.addChild(skip); plugin.setConfiguration(configuration); PluginExecution exec = new PluginExecution(); exec.setId(MavenConfig.MAVEN_DEFAULT_COMPILE); exec.setPhase(MavenConfig.MAVEN_PHASE_NONE); List<PluginExecution> executions = new ArrayList<>(); executions.add(exec); plugin.setExecutions(executions); } }