You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Jason W. Solinsky" <js...@sbsoft.com> on 2005/07/10 19:26:10 UTC

Controlling Tomcat Service From Ant

Is there anyway to effectively start or stop the Tomcat 5.5 windows 
service from within Ant?

I tried

      <exec dir="${tomcat.bin}" executable="tomcat5.exe">
            <arg line="//SS//Tomcat5"/>
      </exec>

but it produces an error message (although it works) and I don't know 
what the corresponding command would be to restart the service. Is there 
some standard way to accomplish this?

Thanks,

JWS

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: Controlling Tomcat Service From Ant

Posted by "Richard Mixon (qwest)" <rn...@qwest.net>.
Yes, if your service  name is "tomcat" you can do something similar to
the following:

  <exec dir="${src}" executable="cmd.exe" os="Windows 2000"
output="dir.txt">
    <arg line="/c net start tomcat"/>
  </exec> 

  <exec dir="${src}" executable="cmd.exe" os="Windows 2000"
output="dir.txt">
    <arg line="/c net stop tomcat"/>
  </exec> 

Check out the Ant "exec" task documentation.

 - Richard

-----Original Message-----
From: Jason W. Solinsky [mailto:jsolinsky@sbsoft.com] 
Sent: Sunday, July 10, 2005 10:26 AM
To: tomcat-user@jakarta.apache.org
Subject: Controlling Tomcat Service From Ant

Is there anyway to effectively start or stop the Tomcat 5.5 windows
service from within Ant?

I tried

      <exec dir="${tomcat.bin}" executable="tomcat5.exe">
            <arg line="//SS//Tomcat5"/>
      </exec>

but it produces an error message (although it works) and I don't know
what the corresponding command would be to restart the service. Is there
some standard way to accomplish this?

Thanks,

JWS

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org