I have an Ant file contains a Junit target, before running the Junit target i have to start the web server(also a target) to let the Unit test run smoothly(there are some web based UI unit tests). However when i start the web server, the ant script is pending and block all following execution. Is there a way to start the web server and then return and running the Unit tests?
<target name="runserver" description="Run hosted mode">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.DevMode">.....</java>
</target>
<target name="test" depends="runserver">
<junit fork="yes" printsummary="yes" haltonerror="true" haltonfailure="true">...</junit>
</target>
you probably have to use “spawn=true” in your exec/java Task. Otherwise after the server has started as a forked process, Ant will be suspended because it tries to read from the standard input. Try in your exec task something like: