ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Levy-Lambert <>
Subject Re: Terminate an Ant target
Date Wed, 19 Jan 2011 20:22:50 GMT

on the JUnit leg of your parallel invocation, you need to use a script 
to kill your http server. Depending on your operating system you could 
use pskill from sysinternals (Windows) or just kill (UNIX).

To find out the process number, there is a tool called pv.exe from 
teamcti which can list Windows processes with the full command line, 
provided the proper format option.

I use pv -e -o"%i %r %d %l"

With this pv command you can find which process is the axis process to 
have the id to be able to selectively kill it.

On UNIX (Solaris) you can achieve the same using /usr/ucb/ps -auxww . 
Not sure other UNIXes.



On 1/19/2011 4:17 AM, Jan C. wrote:
> Hello,
> I use ant to run some JUnit test. My JUnit test need a http server so
> I also start one in my test:
> <target name="mytest" depends="build">
> <parallel failonany="true">
>      <sequential>
>        <!-- Start HTTP server here -->
>         <java fork="yes"
> classname="org.apache.axis2.transport.http.SimpleHTTPServer">
>            ...
>      </sequential>
>      <sequential>
>        <!-- Run JUnit tests here-->
>         <junit>  ...
>      </sequential>
> </parallel>
> </target>
> The problem I have is that the SimpleHTTPServer is running forever so
> even when my JUnit test finish successfully, the ant target does not
> terminate. I can only terminate it using Ctrl+C. Since I want this
> target to be automated, I would like to find a way to "successfully"
> stop the ant target when the junit task finishes.
> Any ideas ?
> cheers,
> Jan
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message