/** * Returns the XML element for this execution within the given Maven POM * * @param document the Maven POM to which to add the element (required) * @return a non-<code>null</code> element */ public Element getElement(final Document document) { final Element executionElement = document.createElement("execution"); // ID if (StringUtils.isNotBlank(id)) { executionElement.appendChild(XmlUtils.createTextElement(document, "id", id)); } // Phase if (StringUtils.isNotBlank(phase)) { executionElement.appendChild(XmlUtils.createTextElement(document, "phase", phase)); } // Goals final Element goalsElement = DomUtils.createChildElement("goals", executionElement, document); for (final String goal : goals) { goalsElement.appendChild(XmlUtils.createTextElement(document, "goal", goal)); } // Configuration if (configuration != null) { final Node configurationNode = document.importNode(configuration.getConfiguration(), true); executionElement.appendChild(configurationNode); } return executionElement; }
final Node configuration = document.importNode(this.configuration.getConfiguration(), true); pluginElement.appendChild(configuration);
.getConfiguration(), document); newParentElement = DomUtils.createChildIfNotExists(elementName, execution.getConfiguration() .getConfiguration(), parentDocument); elementsElement.appendChild(newParentElement); newParentElement = DomUtils.createChildIfNotExists(elementName, execution.getConfiguration() .getConfiguration(), document); elementsElement.appendChild(newParentElement);