You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Mighty Tornado <mi...@gmail.com> on 2009/04/02 22:56:30 UTC
Restarting Tomcat with Ant
Hi,
I used the following configuration:
<property name="TOMCAT" location="/usr/local/tomcat"/>
<target name="stop-tomcat">
<exec dir="${TOMCAT}/bin/" executable="shutdown.sh" />
</target>
but it failed. Told me it cannot find the shell script.
Could anyone please suggest why this is happening?
Re: Restarting Tomcat with Ant
Posted by Mighty Tornado <mi...@gmail.com>.
Thanks,
It worked.
On Fri, Apr 3, 2009 at 1:10 AM, <Ja...@rzf.fin-nrw.de> wrote:
> > <property name="TOMCAT" location="/usr/local/tomcat"/>
> >
> > <target name="stop-tomcat">
> >
> > <exec dir="${TOMCAT}/bin/" executable="shutdown.sh" />
> >
> > </target>
> > but it failed. Told me it cannot find the shell script.
> >
> > Could anyone please suggest why this is happening?
>
>
> <exec executable> specifies what command to run.
>
> <exec dir> specifies where the command should be run. But it does NOT
> specify where the executable should be found.
>
> You could try <exec resolveexecutable|searchpath>.
>
> BUT *.sh are not commands that could be run by the operating system.
> These
> files are run by a command shell.
> http://ant.apache.org/faq.html#batch-shell-execute
>
> Try
> <exec executable="sh">
> <arg value="-c"/>
> <arg value="${TOMCAT}/bin/shutdown.sh"/>
> </exec>
>
>
> Jan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
AW: Restarting Tomcat with Ant
Posted by Ja...@rzf.fin-nrw.de.
> <property name="TOMCAT" location="/usr/local/tomcat"/>
>
> <target name="stop-tomcat">
>
> <exec dir="${TOMCAT}/bin/" executable="shutdown.sh" />
>
> </target>
> but it failed. Told me it cannot find the shell script.
>
> Could anyone please suggest why this is happening?
<exec executable> specifies what command to run.
<exec dir> specifies where the command should be run. But it does NOT
specify where the executable should be found.
You could try <exec resolveexecutable|searchpath>.
BUT *.sh are not commands that could be run by the operating system.
These
files are run by a command shell.
http://ant.apache.org/faq.html#batch-shell-execute
Try
<exec executable="sh">
<arg value="-c"/>
<arg value="${TOMCAT}/bin/shutdown.sh"/>
</exec>
Jan
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org