Ant http不会失败目标

Ian*_*nes 5 ant

我一直试图让这个工作整个下午工作,但不能.我想从我的蚂蚁脚本验证我的应用已启动并运行.似乎下面的任务应该完成这项任务,但事实并非如此.我已经完成了使用细齿梳的ant文档尝试各种排列,但文档在从http中捕获失败方面非常缺乏.谁能帮忙.有没有其他人得到http使用ant ok?

<?xml version="1.0" encoding="UTF-8"?>
<project name="hermes" default="test-app-running" xmlns:epam="epam://epam.com" xmlns:catalina="antlib://catalina.apache.org" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
    <target name="test-app-running" >       
        <waitfor maxwait="10" maxwaitunit="second">
            <http url="http://localhost:8080/" />
        </waitfor>
        <fail message="App did not come up.  Check your log files, fix and try again.  Good Luck :-).">     
            <condition>
                <http url="http://localhost:8080/" />
            </condition>
        </fail>
    </target>
</project>
Run Code Online (Sandbox Code Playgroud)

oer*_*ers 4

条件需要一个<not />. 我刚刚测试过它并且有效。

<fail message="App did not come up.  Check your log files, fix and try again.  Good Luck :-).">     
    <condition>
      <not>
        <http url="http://localhost:8080/" />
      </not>
    </condition>
 </fail>
Run Code Online (Sandbox Code Playgroud)

如果没有 not,如果服务器启动,它将失败。