ResolveParentVersionMojo.java 文件源码

java
阅读 15 收藏 0 点赞 0 评论 0

项目:resolve-parent-version-maven-plugin 作者:
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);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号