You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jacob Kjome <ho...@visi.com> on 2003/05/13 18:57:01 UTC
Re: Install Task and good use of ant tasks
I like your idea for checking whether an app exists before undeploying. I
might start using that myself. As far as the difference between install
and deploy, deploy is persistent across server restarts as it physically
modifies the server.xml and stores the .war file within tomcat's "work"
directory structure. The install task, on the other hand, only installs to
memory. It actually installs the app from wherver it currently exists on
the file system rather than uploading it to Tomcat. A restart of Tomcat
will blow away any hints that the application was ever installed on the
server. This is very useful for development and doesn't cause your
server.xml to become munged by the re-writing that is done when an app is
deployed via the deploy task.
Hope that helps,
Jake
At 01:32 PM 5/14/2003 -0300, you wrote:
>did you put the catalina-ant.jar under the classpath?
>
>btw, i use the deploy task intead install, anyone know the difference?
>
>I tried to use undeploy, but I had some problems, it would not undeploy
>under certain ciscustances. Other problem is that it can't deploy an
>already installed application. besides, it can't undeploy an app not
>deployed, giving an error, so i set 3 tasks, which work nicely to remove
>and redeploy app, even if not already deployed, any comments are welcome
>so we can show the best pratice while integrating ant+tomcat deploy
>
><target name="prepareDeployTomCat"
> depends="web-war"
> description=" deploy to tomcat">
>
><!-- this let me specify the host by a parameter in ant call, otherwise
>not specified, it uses localhost -->
> <condition property="host" value="localhost">
> <not><isset property="host"/></not>
> </condition>
> <echo message="host:${host}"></echo>
>
> <property name="tomcat.server" value="http://${host}:8080"/>
> <property name="path" value="/${name}"/>
>
> <!-- Configure properties to access the Manager application -->
> <property name="url.app" value="${tomcat.server}${path}"/>
> <property name="url" value="${tomcat.server}/manager"/>
> <property name="username" value="tomcat"/>
> <property name="password" value="tomcat"/>
>
> <!-- Configure the custom Ant tasks for the Manager
> application -->
> <taskdef name="deploy"
>classname="org.apache.catalina.ant.DeployTask"/>
> <taskdef name="remove"
>classname="org.apache.catalina.ant.RemoveTask"/>
><!-- see if the app is deployed, to avoid undeploying an unkown app
>an giving an error -->
> <condition property="app.intheairar">
> <http url="${url.app}"/>
> </condition>
> </target>
>
><!-- just do this if app is deployed (in the air) -->
> <target name="undeployTomCat" depends="prepareDeployTomCat"
> if="app.intheair">
> <remove url="${url}" username="${username}" password="${password}"
> path="${path}" />
> <echo message="undeploy ok"/>
> </target>
>
> <target name="deployTomCat" depends="prepareDeployTomCat,undeployTomCat">
>
> <deploy url="${url}" username="${username}" password="${password}"
> path="${path}" war="file:///${web.war.file}"/>
> <echo message="deploy ok"/>
>
> </target>
>
>
>Farrukh Zafar wrote:
>
>>Hi ,
>>
>>I keep on getting this message
>>
>>
>>
>>file:/export/home/farrukh/ServeletApp/build.xml:147: taskdef class \
>>org.apache.catalina.ant.InstallTask cannot be found
>>
>>...
>>
>>..
>>
>>I had copied the catalina-ant.jar directory into $ANT_HOME/lib directory
>>and I know that I had copied it to the right lib directory.
>>
>>
>>
>>
>>Please advice,
>>
>>Thanks,
>>
>>Farrukh zafar
>>
>>_________________________________________________________________
>>STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
>>http://join.msn.com/?page=features/junkmail
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>
>--
>Emerson Cargnin
>Analista de Sitemas
>Setor de Desenvolvimento de Sistemas - TRE-SC
>tel : (048) - 251-3700 - Ramal 3181
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org