@Override public boolean equals(final Object obj) { return obj instanceof Execution && compareTo((Execution) obj) == 0; }
/** * Parses the given XML plugin element for the plugin's executions * * @param plugin the XML element to parse (required) * @return a non-<code>null</code> list */ private static List<Execution> getExecutions(final Element plugin) { final List<Execution> executions = new ArrayList<Execution>(); // Loop through the "execution" elements in the plugin element for (final Element execution : XmlUtils.findElements("executions/execution", plugin)) { final Element idElement = XmlUtils.findFirstElement("id", execution); final String id = DomUtils.getTextContent(idElement, ""); final Element phaseElement = XmlUtils.findFirstElement("phase", execution); final String phase = DomUtils.getTextContent(phaseElement, ""); final List<String> goals = new ArrayList<String>(); for (final Element goalElement : XmlUtils.findElements("goals/goal", execution)) { goals.add(goalElement.getTextContent()); } final Configuration configuration = Configuration.getInstance(XmlUtils.findFirstElement("configuration", execution)); executions.add(new Execution(id, phase, configuration, goals.toArray(new String[goals.size()]))); } return executions; }
if (executionId.equals(execution.getId()) && execution.getConfiguration() != null) { DomUtils.createChildIfNotExists(parentElementName, execution.getConfiguration() .getConfiguration(), document); if (newParentElement == null) { newParentElement = DomUtils.createChildIfNotExists(elementName, execution.getConfiguration() .getConfiguration(), parentDocument); elementsElement.appendChild(newParentElement); if (newParentElement == null) { newParentElement = DomUtils.createChildIfNotExists(elementName, execution.getConfiguration() .getConfiguration(), document); elementsElement.appendChild(newParentElement);
DomUtils.createChildElement("executions", pluginElement, document); for (final Execution execution : executions) { executionsElement.appendChild(execution.getElement(document));
public void installBundlor(String bundleName) { projectOperations.buildPluginUpdate(PLUGIN_DEPENDENCY,new Execution("bundlor","transform")); // copy the template across ProjectMetadata project = (ProjectMetadata) metadataService.get(ProjectMetadata.getProjectIdentifier()); String destination = pathResolver.getIdentifier(Path.ROOT, "template.mf"); if (!fileManager.exists(destination)) { writeTemplateFile(destination,bundleName,project.getDependencies()); } // monitor any dependencies added or removed by other addons projectOperations.addDependencyListener(this); }