PluginExecution execution = new PluginExecution(); execution.setId( getExecutionId( plugin, gs.goal ) ); execution.setPhase( phase );
public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attrs) throws InstantiationException, IllegalAccessException { return new PluginExecution(); }
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 pluginExecution = new PluginExecution(); for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
PluginExecution pluginExecution = new PluginExecution(); InputLocation _location; _location = 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; }
public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attrs) throws InstantiationException, IllegalAccessException { return new PluginExecution(); }
PluginExecution pluginExecution = new PluginExecution(); for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
PluginExecution execution = new PluginExecution(); if (id != null && id.length() > 0) { 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); } }
/** * 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); }
public AbstractMavenPluginConfigurationTranslator(final IMaven maven, final MavenSession session, final MavenProject mavenProject, final MojoExecution mojoExecution, final IProject project, final IProgressMonitor monitor) throws CoreException { this.maven = maven; this.mavenProject = mavenProject; this.project = project; this.mojoExecution = mojoExecution; this.monitor = monitor; this.resourceResolver = AbstractMavenPluginProjectConfigurator .getResourceResolver(mojoExecution, session, project.getLocation()); execution = new PluginExecution(); execution.setConfiguration(mojoExecution.getConfiguration()); }
protected <T> T getParameterValue(String parameter, Class<T> asType, MavenSession session, MojoExecution mojoExecution) throws CoreException { PluginExecution execution = new PluginExecution(); execution.setConfiguration(mojoExecution.getConfiguration()); return maven.getMojoParameterValue(parameter, asType, session, mojoExecution.getPlugin(), execution, mojoExecution.getGoal()); }
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 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; }
private void install() throws XmlPullParserException, IOException { MavenCoreFacet mvn = project.getFacet(MavenCoreFacet.class); Model pom = mvn.getPOM(); org.apache.maven.model.Plugin plugin = new org.apache.maven.model.Plugin(); plugin.setArtifactId(dep.getArtifactId()); plugin.setGroupId(dep.getGroupId()); plugin.setVersion(dep.getVersion()); Xpp3Dom dom = Xpp3DomBuilder.build(new ByteArrayInputStream("<configuration></configuration>".getBytes()), "UTF-8"); List<PluginExecution> executions = plugin.getExecutions(); PluginExecution execution = new PluginExecution(); execution.setPhase("package"); execution.addGoal("shade"); execution.setConfiguration(dom); executions.add(execution); pom.getBuild().getPlugins().add(plugin); mvn.setPOM(pom); }
exec = new PluginExecution(); exec.setId("nb"); //NOI18N assPlugin.addExecution(exec);