reloading webapp from build.xml

2003-01-06 Thread Erik Price
Hi,

I have an ant script (small, b/c I'm new to ant) that builds some 
classes and copies them over to my WEB-INF/classes directory.  But I'd 
like to see if I can program the ant script to reload the webapp too, 
does anyone know how this is done?

Thanks,

Erik

PS (OT of Tomcat, but...): I followed an example build.xml file to make 
mine, and it includes a task named clean that looks like it cleans up 
the build directory.  How can I execute this task from the prompt 
without coding a dependency into the path of execution of the build.xml 
file itself?  Thanks!


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



Re: reloading webapp from build.xml

2003-01-06 Thread Tim Funk
I use wget(http://www.gnu.org/directory/GNU/wget.html) with ant.

It is similar to this:

Properties to have set somewhere (build.properties):
  webapp.path=/mywebapp
  tomcat.instance=localhost:8080
  tomcat.user=foo
  tomcat.passwd=bar
  wget.dir=/usr/local/bin/
  wget.exe=wget

ANT SNIPPET:
*
  target name=reload
exec dir=${wget.dir} executable=${wget.exe}
  arg line=--spider --http-user=${tomcat.user} 
--http-passwd=${tomcat.passwd} 
http://${tomcat.instance}/manager/reload?path=${webapp.path}/
/exec
  /target
*


-Tim

Erik Price wrote:
Hi,

I have an ant script (small, b/c I'm new to ant) that builds some 
classes and copies them over to my WEB-INF/classes directory.  But I'd 
like to see if I can program the ant script to reload the webapp too, 
does anyone know how this is done?

Thanks,

Erik

PS (OT of Tomcat, but...): I followed an example build.xml file to make 
mine, and it includes a task named clean that looks like it cleans up 
the build directory.  How can I execute this task from the prompt 
without coding a dependency into the path of execution of the build.xml 
file itself?  Thanks!


--
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]




Re: reloading webapp from build.xml

2003-01-06 Thread Jacob Kjome

See the example at:

http://jakarta.apache.org/tomcat/tomcat-5.0-doc/appdev/
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/appdev/sample/

It provides examples using the Tomcat Ant manager tasks which is exactly 
what you need.

Jake

At 08:04 AM 1/6/2003 -0500, you wrote:
Hi,

I have an ant script (small, b/c I'm new to ant) that builds some classes 
and copies them over to my WEB-INF/classes directory.  But I'd like to see 
if I can program the ant script to reload the webapp too, does anyone know 
how this is done?

Thanks,

Erik

PS (OT of Tomcat, but...): I followed an example build.xml file to make 
mine, and it includes a task named clean that looks like it cleans up 
the build directory.  How can I execute this task from the prompt without 
coding a dependency into the path of execution of the build.xml file 
itself?  Thanks!


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


Re: reloading webapp from build.xml

2003-01-06 Thread Erik Price


Tim Funk wrote:

I use wget(http://www.gnu.org/directory/GNU/wget.html) with ant.


Tim,

Thanks for your idea -- it's a good one and I didn't even think of it. 
But according to the link Jacob Kjome posted, the same can be done using 
a build.properties and custom ant task with the catalina-ant.jar 
classes.  The only reason I'd choose this over wget is that it would 
appear that the wget approach puts the username/password on the command 
line itself, so that would be viewable to any other users using top or 
ps or similar process-watching software.

I'm assuming of course that I can somehow protect the build.properties 
file from other users as well...


Thanks again,

Erik


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



Re: reloading webapp from build.xml

2003-01-06 Thread Tim Funk
You could always use a .wgetrc to contain those parameters.

Or ant's GET task probably does the trick too since it supports BASIC 
authentication.

In the near future - I hope to change my deploy tasks to use ant's GET 
instead of wget.

-Tim

Erik Price wrote:


Tim Funk wrote:


I use wget(http://www.gnu.org/directory/GNU/wget.html) with ant.



Tim,

Thanks for your idea -- it's a good one and I didn't even think of it. 
But according to the link Jacob Kjome posted, the same can be done using 
a build.properties and custom ant task with the catalina-ant.jar 
classes.  The only reason I'd choose this over wget is that it would 
appear that the wget approach puts the username/password on the command 
line itself, so that would be viewable to any other users using top or 
ps or similar process-watching software.

I'm assuming of course that I can somehow protect the build.properties 
file from other users as well...


Thanks again,

Erik


--
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]




Re: reloading webapp from build.xml

2003-01-06 Thread Paul Campbell
ant does reload.

Look in the Application Developer documentation
http://localhost:8080/tomcat-docs/appdev/index.html

At 08:04 AM 1/6/2003 -0500, you wrote:
Hi,

I have an ant script (small, b/c I'm new to ant) that builds some classes and copies 
them over to my WEB-INF/classes directory.  But I'd like to see if I can program the 
ant script to reload the webapp too, does anyone know how this is done?

Thanks,

Erik

PS (OT of Tomcat, but...): I followed an example build.xml file to make mine, and it 
includes a task named clean that looks like it cleans up the build directory.  How 
can I execute this task from the prompt without coding a dependency into the path of 
execution of the build.xml file itself?  Thanks!


--
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]