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" ) ); } } }
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() ); } } } } }
execution.setId( getExecutionId( plugin, gs.goal ) ); execution.setPhase( phase ); execution.setPriority( i - mojos.size() );
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.setId( interpolatedTrimmed( parser.nextText(), "id" ) );
pluginExecution.setId( interpolatedTrimmed( parser.nextText(), "id" ) );
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.setId( getTrimmedValue( value ) );
execution.setId(id);
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); } }
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" ) ); } } }
/** * Converts the given source {@link BCExecution} object into a new target * {@link PluginExecution} object. * * @param execution * source {@link BCExecution} object. * * @return a new target {@link PluginExecution} object or {@code null} if * {@link BCExecution#getAction} is {@code skip} or not {@code add} * or {@code add-update}. */ @Override public PluginExecution add(final BCExecution execution) { String action = ELUtils.getStringValue(elContext, execution.getAction()); if (BCExecution.ACTION_SKIP.equals(action) || !BCExecution.ACTION_ADD.equals(action) && !BCExecution.ACTION_ADD_UPDATE.equals(action)) { return null; } PluginExecution projectExecution = new PluginExecution(); projectExecution.setId(ELUtils.getStringValue(elContext, execution.getId())); return updateInternal(projectExecution, execution); }
private void addBuildPlugin(Model model) { GAV projectGav = GAV.of(model); logger.debug(projectGav + " temporary add build plugin"); Plugin projectPlugin = VersioningPomReplacementMojo.asPlugin(); PluginExecution execution = new PluginExecution(); execution.setId(VersioningPomReplacementMojo.GOAL); execution.getGoals().add(VersioningPomReplacementMojo.GOAL); projectPlugin.getExecutions().add(execution); if (model.getBuild() == null) { model.setBuild(new Build()); } model.getBuild().getPlugins().add(projectPlugin); }
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; }
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); } }
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; }
/** * Interpolates elements of the {@link PluginExecution} object. * * @param execution * {@link PluginExecution} object whose elements to interpolate. */ private void interpolateExecution(final PluginExecution execution) { execution.setId( interpolateString(execution.getId())); execution.setInherited( interpolateString(execution.getInherited())); execution.setPhase( interpolateString(execution.getPhase())); interpolateDOM((Xpp3Dom) execution.getConfiguration()); interpolateStrings(execution.getGoals()); }
if (exec == null) { exec = new PluginExecution(); exec.setId("nb"); //NOI18N assPlugin.addExecution(exec);
execution.setId(id); execution.setPhase(task.getPhase()); execution.setGoals(goals);