Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以使用 ANT 任务检查端口是否打开?
我需要执行 flexunit 任务,但在开始此任务之前,我需要检查另一个 flexunit 任务是否未运行并阻塞所需的端口。
感谢您的任何建议,
拉法尔
使用 ant socket 条件。
<target name="check-port" description="Check whether Tomcat is running"> <echo message="Checking whether Tomcat is running"/> <condition property="tomcat.running"> <socket server="${tomcat.host}" port="${tomcat.port}"/> </condition> </target>
http://ant.apache.org/manual/Tasks/conditions.html