我在将目标replace运行到xmltask时出错
C:\Tools\build.xml:432: The following error occurred while executing this line:
C:\Tools\build.xml:408: Failed to specify text in replace问题是我的同事在他的电脑上运行相同的代码没有问题。我搞不懂为什么我会犯错,而我的同事却没有。
build.xml的部分如下:
<target name="replace" depends="init" description="replace node.">
<xmltask source="${my-file}" dest="${my-file}">
<replace path=
"/*[local-name()='server']
/*[local-name()='profile']
/*[local-name() = 'subsystem'][1]"
withFile="${devlogfile}"/>
</xmltask>
</target>
<target name="init">
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="${ant.lib.dir}/ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
<taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask">
<classpath>
<pathelement path="${ant.lib.dir}/xmltask.jar"/>
</classpath>
</taskdef>
</target>属性文件的部分如下:
my-file=c:/old.xml
devlogfile=c:/new.xml发布于 2015-11-16 20:54:45
从评论部分转换而来
在你的同事和你自己的情况下,你比较了jdk和类路径吗?用到目前为止所给出的信息来判断是不可能的,但是您可能使用的是不同的解析器。
错误消息表明Ant没有找到devlogfile文件本身。您确定属性文件已正确传递到ant运行时吗?你是怎么通过的?
https://stackoverflow.com/questions/33684248
复制相似问题