【发布时间】:2020-09-19 05:45:03
【问题描述】:
下面是我的代码。我们正在使用 Ant 版本 1.9.11 并尝试使用 ant-contrib-1.0b3.jar 和 ant-contrib-1.0b2.jar。
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
<taskdef resource="net/sf/antcontrib/antlib.xml"/>
<target name=abc>
<if>
<equals arg1="${xyz}" arg2="true"/>
<then>
<replace file="src/com/xyz.java" token="DEBUG = false;" value="DEBUG = true;" />
</then>
<else>
<echo message="${xyz} is not enabled "/>
</else>
</if>
</target>
我也尝试过使用 ant contrib 的完整路径,如下所示,但仍然遇到相同的错误。
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="/opt/apache-ant-1.9.11/lib/ant-contrib-1.0b3.jar"/>
</classpath>
非常感谢帮助我解决此问题。
【问题讨论】:
标签: ant ant-contrib