ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conelly, Luis (EM, DDEMESIS)" <>
Subject RE: <exec> task
Date Wed, 12 Nov 2003 16:28:37 GMT
Hi all,

	That's how I finally made tomcat start from my Ant script. 

Start Tomcat:

    <target name="startTomcat" description="Starts Local Tomcat Server">
        <echo message="Tomcat Startup file located @ ${tomcat.home}\bin\startup.bat"/>
        <exec dir="${tomcat.home}\bin" executable="${tomcat.home}\bin\startup.bat"
              newenvironment="true" os="Windows 2000" vmlauncher="false">


    <target name="startTomcat" description="Starts Local Tomcat Server">
        <exec dir="${tomcat.home}/bin" executable="cmd.exe"
            <arg value="/C"/>
            <arg value="startup.bat"/>

	Both targets works practically the same. One small issue comes with both of these solutions:
when I execute them, the startup.bat file does not return the control to my console and I
have to send a Ctrl+C keystroke and answer 'n' when the shell ask me if I want to finish the
batch job. It is kind of annoying, but I haven't found any workaround on this... besides this
small inconvenient, it works just as good as it gets.

Stop Tomcat:

    <target name="stopTomcat" description="Starts Local Tomcat Server">
        <exec dir="${tomcat.home}\bin" executable="${tomcat.home}\bin\shutdown.bat"
              newenvironment="true" os="Windows 2000"/>

	No issues on this target... is executed fine and returns the control fine.

	Thanks for your help. I really appreciated it and was very helpful.

BTW, these are my settings, in case you have something similar

OS: Win2K
JDK: 1.3.1 / 1.4.1_02
ANT: 1.5.2
Jakarta Tomcat: 4.1.27

Luis G Conelly
Mobile (+52)(449)123-8749
There are 10 kinds of programmers:
* Those who know binary code
* Those who does not

-----Original Message-----
From: Conor MacNeill []
Sent: Tuesday, November 11, 2003 9:39 PM
To: Ant Users List
Subject: Re: <exec> task

On Wed, 12 Nov 2003 01:57 pm, Jing Xue wrote:
> Quoting "Conelly, Luis (EM, DDEMESIS)" <>:
> [snip]
> > 1. Does <exec> task just support .exe files (which I think it is not,
> > since the task executes other files in other OS environments besides
> > Windows)?
> You can't exec a batch file in Windows directly. You have to do something
> like (untested):

You can execute a bath file by using vmlauncher="false". I think you can also 
execute a batch file by givin the full path to it but I'm not 100% on that


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

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

View raw message