ターゲット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