There are also the ant tasks in the catalina-ant.jar (or something close)
file that is distributed with tomcat. This makes for some easy integration
with ant.

Brad



                                                                                       
                                  
                      "Raible, Matt"                                                   
                                  
                      <[EMAIL PROTECTED]         To:      "'Struts Users Mailing 
List'"                                
                      omcast.com>                  <[EMAIL PROTECTED]>    
                                  
                                                   cc:                                 
                                  
                      21-01-03 12:34               Subject: restarting tomcat with Ant 
                                  
                      Please respond to                                                
                                  
                      "Struts Users                                                    
                                  
                      Mailing List"                                                    
                                  
                                                                                       
                                  
                                                                                       
                                  




Personally, I use aliases in my .bashrc file (if on Windows, use cygwin):

alias tstart='$CATALINA_HOME/bin/startup.bat'
alias tstop='$CATALINA_HOME/bin/shutdown.bat'

Then I can just to tstop and tstart from the command line and start/stop
tomcat.  However, if you *really* want to do it from Ant, here's what I
have
for Cactus:

<!-- ===================================================================
-->
<!--            Start Tomcat 4.x
-->
<!-- ===================================================================
-->
<target name="start.tomcat">
    <java classname="org.apache.catalina.startup.Bootstrap" fork="yes">
        <jvmarg value="-Dcatalina.home=${tomcat.home}"/>
        <!--arg value="-config"/>
        <arg value="${basedir}/
${out.server.dir}/conf/server.xml"/-->
        <arg value="start"/>
        <classpath>
            <fileset dir="${tomcat.home}">
                <include name="bin/bootstrap.jar"/>
                <include name="server/catalina.jar"/>
            </fileset>
        </classpath>
    </java>
</target>
<!-- ===================================================================
-->
<!--            Stop Tomcat 4.x
-->
<!-- ===================================================================
-->
<target name="stop.tomcat">
    <java classname="org.apache.catalina.startup.Bootstrap" fork="yes">
        <jvmarg value="-Dcatalina.home=${tomcat.home}"/>
        <arg value="stop"/>
        <classpath>
            <fileset dir="${tomcat.home}">
                <include name="bin/bootstrap.jar"/>
                <include name="server/catalina.jar"/>
            </fileset>
        </classpath>
    </java>
</target>


> -----Original Message-----
> From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 21, 2003 1:25 PM
> To: Struts Users Mailing List
> Subject: RE: AW: easy struts
>
>
>
>
> On Tue, 21 Jan 2003, ROSSEL Olivier wrote:
>
> >
> > Can anyone tell me if Ant is able to start/stop Tomcat?
> >
>
> Cactus includes some Ant targets that do this, but I've never
> needed them.
> I just leave Tomcat running all the time and used the dynamic install,
> reload, and remove commands that come with Tomcat 4.1.
>
> Starting and stopping Tomcat takes *way* too long in a
> development cycle,
> on matter how you actually do it.
>
> Craig
>
>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>


--
To unsubscribe, e-mail:   <
mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <
mailto:[EMAIL PROTECTED]>







--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to