使用tomcat管理器命令運行Ant目標時,它們看起來是成功的,但是報告BUILD FAILED。當Ant Tomcat任務似乎成功時,爲什麼Eclipse報告BUILD FAILED?
這裏是我的build.xml的相關部分:
<property name="path" value="/MyApp"/>
<property name="manager-url" value="http://localhost:8080/manager/html"/>
<property name="username" value="admin"/>
<property name="password" value=""/>
<taskdef name="start" classname="org.apache.catalina.ant.StartTask"/>
<taskdef name="stop" classname="org.apache.catalina.ant.StopTask"/>
<taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"/>
<target name="start" description="Start web application">
<start url="${manager-url}" username="${username}" password="${password}" path="${path}" output="${tomcat-home}/webapps/start.html"/>
</target>
<target name="stop" description="Stop web application">
<stop url="${manager-url}" username="${username}" password="${password}" path="${path}" output="${tomcat-home}/webapps/stop.html"/>
</target>
<target name="undeploy" description="Start web application">
<undeploy url="${manager-url}" username="${username}" password="${password}" path="${path}" output="${tomcat-home}/webapps/undeploy.html"/>
</target>
當我運行這些目標(啓動,停止,取消)從日食我得到的輸出類似如下:
Buildfile: C:\eclipse_3.5\eclipse\workspace\MyApp\build.xml
Trying to override old definition of datatype resources
undeploy:
BUILD FAILED
C:\eclipse_3.5\eclipse\workspace\MyApp\build.xml:85: <html>
Total time: 20 seconds
由目標重定向的輸出是表明Tomcat管理器命令成功的html文件,當我檢查管理器時,它看起來像是。
的標籤是不是在我的build.xml。它位於由undeploy調用返回的html中。如您所見,我將輸出重定向到名爲undeploy.html的文件。我會貼上它的內容在這裏: http://pastebin.com/shrxYk7v 正如你所看到的HTML文件管理器頁面的狀態在頂部此消息的快照: OK - 取消部署應用程序的上下文路徑/ MyApp – vecima