private Element getParentVersionElement(Document doc) throws MojoExecutionException {
XPath xPath = XPathFactory.newInstance().newXPath();
try {
NodeList nodes = ((NodeList) xPath.evaluate("/project/parent/version", doc.getDocumentElement(), XPathConstants.NODESET));
if (nodes.getLength() == 0) {
return null;
}
return (Element) nodes.item(0);
} catch (XPathExpressionException e) {
throw new MojoExecutionException("Failed to evaluate xpath expression", e);
}
}
ResolveParentVersionMojo.java 文件源码
java
阅读 15
收藏 0
点赞 0
评论 0
项目:resolve-parent-version-maven-plugin
作者:
评论列表
文章目录