From 4babb694614f1cadb98c2a7777e06d3e8ccbdd27 Mon Sep 17 00:00:00 2001 From: lsy <18332763730@163.com> Date: Thu, 7 Dec 2017 19:22:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/micro/fast/util/XmlUtil.java | 13 +++++++++---- boot-starter/pom.xml | 5 ++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/boot-starter/boot-starter-util/src/main/java/com/micro/fast/util/XmlUtil.java b/boot-starter/boot-starter-util/src/main/java/com/micro/fast/util/XmlUtil.java index c1d01cc..38209c0 100644 --- a/boot-starter/boot-starter-util/src/main/java/com/micro/fast/util/XmlUtil.java +++ b/boot-starter/boot-starter-util/src/main/java/com/micro/fast/util/XmlUtil.java @@ -25,7 +25,7 @@ public class XmlUtil { * @param xPathPattern * @param newValue */ - public void modifyXmlText(String xmlPath,String xPathPattern,String newValue){ + public Document modifyXmlText(String xmlPath,String xPathPattern,String newValue){ DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder documentBuilder; Document document = null; @@ -60,6 +60,11 @@ public class XmlUtil { Element element = (Element) nodeList.item(i); element.setTextContent(newValue); } + + return document; + } + + public void writeDocument(Document document,String xmlPath){ TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = null; @@ -75,8 +80,8 @@ public class XmlUtil { } } - public static void main(String[] args) { - new XmlUtil().modifyXmlText("/root/dev/workspace/micro-fast/boot-starter/pom.xml","//parent/version","1"); - } +// public static void main(String[] args) { +// new XmlUtil().modifyXmlText("/root/dev/workspace/micro-fast/boot-starter/pom.xml","//parent/version","1"); +// } } diff --git a/boot-starter/pom.xml b/boot-starter/pom.xml index 143d39a..a1e89c5 100644 --- a/boot-starter/pom.xml +++ b/boot-starter/pom.xml @@ -1,6 +1,5 @@ - - + + 4.0.0 boot-starter