I'm doing a project like this now and it's working out very well. It invokes ant from a servlet to execute a chain of several specific custom tasks based on the ant target specified in the servlet params. The tasks are not related to building java code. Generally, the output of one task becomes the input of the next. I enabled the tasks to share java objects by creating a new class derived from the ant Project class that has some data repository maps. The task code can call getProject() and cast the result to the custom derived class to get at the repository.

Scott


Yaron Ruckenstein wrote:
Martin and Markus

Thanks a lot for your help. I'll try to explain again my considerations.

I'm using Ant for compile, build and deploy my project.

My intention is to create a new Ant script to be used only for executing the different processes that compose my company's product.

This Ant script shall replace the set of Unix and windows script
that are used now.

I'm not sure if this is a good approach when in production environment.

Maybe I'm wrong, but do you recommend to use Ant to run Tomcat
(and maybe all other Java processes) in production environment ?
This sound reasonable, because a JVM is loaded anyway, and if we do not fork, all the overhead we get is loading some extra classes, and some extra processing.
What do you think ?

Thanks again,
Yaron.

-----Original Message-----
From: Martin [mailto:[EMAIL PROTECTED]]
Sent: 26 July 2002 19:51
To: Ant Users List
Subject: Re: Running processes with Ant


Yaron/Markus:
I have found a Tomcat 4.0 Startup script which you run by executing command
line option
ant start.tomcat.40 (courtesy Cactus Users Group)
Best Regards,

<!--
  ========================================================================
    Start Tomcat 4.0
  ========================================================================
-->
<target name="start.tomcat.40">

   <java classname="org.apache.catalina.startup.Bootstrap" fork="yes">
       <jvmarg value="-Dcatalina.home=${tomcat.home.40}"/>
       <jvmarg value="-Dcatalina.base=${target.tomcat40.dir}"/>
       <arg value="start"/>
       <classpath>
         <fileset dir="${tomcat.home.40}">
             <include name="bin/bootstrap.jar"/>
         </fileset>
       </classpath>
   </java>

</target>


Hello Yaron,
I did not fully understand what you woould like to do with you ANT
scripts. But I sounds like you are doing the whole build process with
shell scripts and batch-files. Especially for this matter ANT is build.
I am currently working on a large scale application using EJBs, Modules,
Configuration Management, Unit Tests, etc. All the build process is done
with ANT. Especially the Classpath thing is done using ANT as a base and
Greebo for the Repository of the JARs.

I believe that ANT is a full replacement for the make process, even
though it gets difficult, if you would like to do loops and stuff. But
the most stuff you will find in some plugins, and the only thing, you
have to do, is build your build.xml.

If you would like to do some stuff like starting up Tomcat , then ithis
is possible also, but I haven't tested this, except for starting Tomcat
up for Unit Tests, but not in a live environment.

So, therefor my experience tells me that you don't have to worry about
using ANT. You have to worry, if you are not doing it.

Greets

Markus M. May

---------------------

Yaron Ruckenstein wrote:


Hi,

My company's product is made out of several processes
such as Apache, Tomcat, Java, and more 3rd party tools.

Currently I use .sh and .bat scripts to run the processes
on different platforms.

It is very tempting to replace all these scripts with an ant script,
and solve issues like running on different platforms and building the
classpath.

However I'm worried that using Ant is much more expensive.
If I do not use Ant, then I execute a shell that brings up a JVM,
load my process classes, and other libraries, and execute them.
If I use Ant, I add to this loading the ant.jar, and the build.xml,
and this consumes memory and CPU resources.

Also, if I use the fork option of the Java task, then I get an extra JVM
for each process. If I do not, then I have a JVM that loads more classes,
and consumes more resources.

I will very happy to hear you comments.

Thanks,

Yaron Ruckenstein




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

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