tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leon Rosenberg" <rosenberg.l...@googlemail.com>
Subject Re: Deploy from ant
Date Thu, 04 Jan 2007 21:06:53 GMT
Why not just drop in the new war file created from the ant war task?
Tomcat will reload the app automatically. On a half-way fast pc it
will last 10 seconds (depending on the size of the webapp of course,
and the amount of work need to be done on undeploy/deploy)

Leon

	<target name="war" depends="init,compile,complete.web">		
		<war destfile="${output}/${webapp.name}.war" webxml="${web.xml.file}">
			<fileset dir="${output.webapp}"/>
		</war>
	</target>
	
	<target name="deploy.web" depends="war">
		<copy tofile="${servletcontainer.home}/webapps/${webapp.name}.war">
			<fileset file="${output}/${webapp.name}.war"/>
		</copy>
	</target>

and you are done.

On 1/4/07, Carlos Pita <carlosjosepita@gmail.com> wrote:
> Hi all,
>
> how do I deploy a webapp from the ant deploy task avoiding it to copy
> the entire application under tomcat/webapps? The point is to simply
> update my build directory with modified jsps to make tomcat aware of
> the changes. If this build directory, which of course is not under
> webapps, is first copied under webapps by the ant deploy task, then
> nothing is updated there each time I build the app, and instead I have
> to explicitly redeploy it. One solution that comes to my mind is to
> deploy an xml context descriptor instead of a exploded war directory.
> But anyway, from the documentation here:
>
> http://tomcat.apache.org/tomcat-6.0-doc/appdev/source.html
> http://tomcat.apache.org/tomcat-6.0-doc/appdev/processes.html
>
> I would infer that deploying my application by means of a target like
>
>   <target name="tomcat-deploy" depends="init,build,init-ant"
> description="Deploy application to servlet container">
>     <tomcat-deploy url="${tomcat.manager.url}"
> username="${tomcat.manager.username}"
>                    password="${tomcat.manager.password}"
> path="${tomcat.context.path}"
>                    war="file://${project.build.path}" />
>  </target>
>
> will in principle install the application into tomcat without copying
> it into webapps, which in practice it doesn't.  The following excerpts
> from the above links seem to support my supposition:
>
> """
> For interactive development and testing of your web application using
> Tomcat 5, the following additional targets are defined:
>
>     * install - Tell the currently running Tomcat 5 to make the
> application you are developing immediately available for execution and
> testing. This action does not require Tomcat 5 to be restarted, but it
> is also not remembered after Tomcat is restarted the next time.
> """
>
> (notice that the install target uses the deploy task, despite of its name)
>
> """
> # Modify and rebuild as needed. As you discover that changes are
> required, make those changes in the original source  files, not in the
> output build directory, and re-issue the ant compile command. This
> ensures that your changes will be available to be saved (via cvs
> commit) later on -- the output build directory is deleted and
> recreated as necessary.
>
> # Reload the application. Tomcat will recognize changes in JSP pages
> automatically, but it will continue to use the old versions of any
> servlet or JavaBean classes until the application is reloaded. You can
> trigger this by executing the ant reload command.
> """
>
> Can you help me? I find this very confusing.
>
> Thank you in advance.
>
> Regards,
> Carlos
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message