【发布时间】:2014-03-12 01:53:09
【问题描述】:
我有以下 ANT 脚本来启动/停止 tomcat:
<project name="sample">
<property name="name" value="sample"/>
<path id="catalina-ant-classpath">
<fileset dir="D:\apache-tomcat-7.0.47-windows-x64\apache-tomcat-7.0.47\lib">
<include name="catalina-ant.jar"/>
</fileset>
</path>
<taskdef name="start" classname="org.apache.catalina.ant.StartTask">
<classpath refid="catalina-ant-classpath"/>
</taskdef>
<taskdef name="stop" classname="org.apache.catalina.ant.StopTask">
<classpath refid="catalina-ant-classpath"/>
</taskdef>
<target name="start" description="Start Tomcat application">
<start url="http://localhost:8080/manager"
username="uname"
password="pwd"/>
</target>
<target name="stop" description="Stop Tomcat application">
<stop url="http://localhost:8080/manager"
username="uname"
password="pwd"/>
</target>
</project>
当我在上面运行脚本时,它会抛出以下错误:
D:\apache-ant-1.9.3-bin\apache-ant-1.9.3\bin>ant build.xml 停止 构建文件:D:\apache-ant-1.9.3-bin\apache-ant-1.9.3\bin\build.xml 构建失败 项目“sample”中不存在目标“build.xml”。
上面的脚本有什么问题吗?
谢谢!
【问题讨论】:
-
这是你的完整 build.xml 吗?
-
是的 Sanjeev...这是我的 build.xml