You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Carlos Pita <ca...@gmail.com> on 2007/01/04 21:35:10 UTC

Deploy from ant

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


Re: Deploy from ant

Posted by Veit Guna <ve...@gmx.de>.
I agree with you! So, I have a plain ant project, too which let me do
all things that are necessary for deployment (war, remote-deploy etc.).
It's always a good idea to have a build-system that allows building and
deploying without user-interaction for automated things.

But that isn't a problem with eclipse?! You can configure your WTP
project without modifying your project structure. I've migrated my
simple java project to a WTP project and it works like a charm. Now I
have the best of two worlds :).

regards,
Veit


Carlos Pita schrieb:
> I'm currently using WTP just for editing xml and jsp (btw, I would
> love that it supported EL autocompletion for the MVC model). OTOH I'm
> a bit reluctant to adopt the entire web WTP proyect approach, I prefer
> to control my vanilla java project from ant targets. Anyway, regarding
> the ant deploy task, I will follow advice from you all and stop
> worrying about making sense of what the developer manual suggests in
> this respect. I will put my build directory under webapps, or
> alternatively a symlink to it, or I will just deploy an xml context
> descriptor pointing to my build directory anywhere in the filesystem.
> Thank you all.
> Cheers,
> Carlos
> 
> On 1/4/07, Veit Guna <ve...@gmx.de> wrote:
>> Hi.
>>
>> All I can say is, that you don't want to deploy your war file through an
>> ant task to tomcat. Believe me. Not for development. For a small change
>> in the webcontent you have to redeploy the whole app - very annoying. I
>> used that half a year.
>>
>> Now I use the Eclipse WTP Project for development with hot-code-replace
>> and webdeployment. Sure it isn't perfect, but changes are instantly
>> accessible in the webapp - and that's what one is looking for.
>>
>> It takes some time to figure out, how it works, but when finally
>> configured, you won't miss it anymore!
>>
>> Take a look at it:
>>
>> http://www.eclipse.org/webtools/
>>
>> Hope that helps.
>>
>> regards,
>> Veit
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
> 

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


Re: Deploy from ant

Posted by Carlos Pita <ca...@gmail.com>.
I'm currently using WTP just for editing xml and jsp (btw, I would
love that it supported EL autocompletion for the MVC model). OTOH I'm
a bit reluctant to adopt the entire web WTP proyect approach, I prefer
to control my vanilla java project from ant targets. Anyway, regarding
the ant deploy task, I will follow advice from you all and stop
worrying about making sense of what the developer manual suggests in
this respect. I will put my build directory under webapps, or
alternatively a symlink to it, or I will just deploy an xml context
descriptor pointing to my build directory anywhere in the filesystem.
Thank you all.
Cheers,
Carlos

On 1/4/07, Veit Guna <ve...@gmx.de> wrote:
> Hi.
>
> All I can say is, that you don't want to deploy your war file through an
> ant task to tomcat. Believe me. Not for development. For a small change
> in the webcontent you have to redeploy the whole app - very annoying. I
> used that half a year.
>
> Now I use the Eclipse WTP Project for development with hot-code-replace
> and webdeployment. Sure it isn't perfect, but changes are instantly
> accessible in the webapp - and that's what one is looking for.
>
> It takes some time to figure out, how it works, but when finally
> configured, you won't miss it anymore!
>
> Take a look at it:
>
> http://www.eclipse.org/webtools/
>
> Hope that helps.
>
> regards,
> Veit
>
>
>
>
> ---------------------------------------------------------------------
> 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


Re: Deploy from ant

Posted by Veit Guna <ve...@gmx.de>.
Hi.

All I can say is, that you don't want to deploy your war file through an
ant task to tomcat. Believe me. Not for development. For a small change
in the webcontent you have to redeploy the whole app - very annoying. I
used that half a year.

Now I use the Eclipse WTP Project for development with hot-code-replace
and webdeployment. Sure it isn't perfect, but changes are instantly
accessible in the webapp - and that's what one is looking for.

It takes some time to figure out, how it works, but when finally
configured, you won't miss it anymore!

Take a look at it:

http://www.eclipse.org/webtools/

Hope that helps.

regards,
Veit




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


Re: Deploy from ant

Posted by Carlos Pita <ca...@gmail.com>.
> Amen to that :-)  So why not just use the deployment directory as the
> development directory? Edit your JSP, click browser's reload, done.

Yes, of course I thought of that, and also of just deploying the xml
context descriptor with the docBase pointing to my build directory,
just in case I preferred to keep it outside tomcat/webapps. But I'm
asking about the way to deploy the app via the deploy ant task because
it seems to be the recommended practice (according to
http://tomcat.apache.org/tomcat-6.0-doc/appdev/index.html). So I'm not
sure if that document is wrong regarding this task, or if it's
outdated, or if I'm misunderstanding it  (I mean, perhaps it doesn't
really imply that the app won't be copied to webapps, but then how do
you explain this affirmations?:
# This action (depploy) does not require Tomcat 5 to be restarted, but
it is also not remembered after Tomcat is restarted the next time.
# Tomcat will recognize changes in JSP pages automatically (after just
building the app, which copies modified jsps to the build directory)
).

Best regards,
Carlos

On 1/4/07, Hassan Schroeder <ha...@gmail.com> wrote:
> On 1/4/07, Carlos Pita <ca...@gmail.com> wrote:
>
> > Copy the entire app war, explode it, deploy it (and of course
> > recompile the requested jsp),
> > all that just to check, say, that a typo in the view was corrected or
> > that some cell contents are now correctly aligned?
>
> > It seems overkilling for checking tiny changes in jsps to me.
>
>
> YMMV, of course :-)
> --
> Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
>
> ---------------------------------------------------------------------
> 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


Re: Deploy from ant

Posted by Hassan Schroeder <ha...@gmail.com>.
On 1/4/07, Carlos Pita <ca...@gmail.com> wrote:

> Copy the entire app war, explode it, deploy it (and of course
> recompile the requested jsp),
> all that just to check, say, that a typo in the view was corrected or
> that some cell contents are now correctly aligned?

> It seems overkilling for checking tiny changes in jsps to me.

Amen to that :-)  So why not just use the deployment directory as the
development directory? Edit your JSP, click browser's reload, done.

YMMV, of course :-)
-- 
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

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


Re: Deploy from ant

Posted by Carlos Pita <ca...@gmail.com>.
Thank you for your prompt answer, really, but please notice the
original question was:

how do I deploy a webapp ***from the ant deploy task*** avoiding it to copy
the entire application under tomcat/webapps?

I was trying to follow the development process described at
http://tomcat.apache.org/tomcat-6.0-doc/appdev/index.html  until I
found out that in practice it doesn't work exactly as explained there,
so the intention of the post was to clarify the use of ant deploy
task.

Best regards,
Carlos

On 1/4/07, Leon Rosenberg <ro...@googlemail.com> wrote:
>         <target name="copy_jsps" >
>                 <copy todir="${output.webapp}">
>                         <fileset dir="${web.dir}">
>                                 <include name="**/*"/>
>                         </fileset>
>                         <fileset dir="${src.dir}">
>                                 <include name="**/*.vm"/>
>                                 <include name="**/*.jsp"/>
>                         </fileset>
>                 </copy>
>       </target>
> and copy_jsps
> 1 second and you are done, and don't have to change your project
> structure, neither your deployment.
>
>
> On 1/4/07, Carlos Pita <ca...@gmail.com> wrote:
> > > Why not just drop in the new war file created from the ant war task?
> > > Tomcat will reload the app automatically.
> >
> > Copy the entire app war, explode it, deploy it (and of course
> > recompile the requested jsp),
> > all that just to check, say, that a typo in the view was corrected or
> > that some cell contents are now correctly aligned?
> >
> > > On a half-way fast pc it  will last 10 seconds (depending on the size of
> > > the webapp of course,
> >
> > That's just about what it last on my pc. It seems overkilling for
> > checking tiny changes in jsps to me.
> >
> > Anyway, the documentation I referred from my previous post seems to
> > suggest that the task is able to deploy the app without copying it
> > (not to mention without "waring" it).
> >
> > Best regards,
> > Carlos
> >
> >
> >
> > On 1/4/07, Leon Rosenberg <ro...@googlemail.com> wrote:
> > > 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 <ca...@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
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > 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
>
>

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


Re: Deploy from ant

Posted by Leon Rosenberg <ro...@googlemail.com>.
	<target name="copy_jsps" >
		<copy todir="${output.webapp}">
			<fileset dir="${web.dir}">
				<include name="**/*"/>
			</fileset>
			<fileset dir="${src.dir}">
				<include name="**/*.vm"/>
				<include name="**/*.jsp"/>
			</fileset>
		</copy>
      </target>
and copy_jsps
1 second and you are done, and don't have to change your project
structure, neither your deployment.


On 1/4/07, Carlos Pita <ca...@gmail.com> wrote:
> > Why not just drop in the new war file created from the ant war task?
> > Tomcat will reload the app automatically.
>
> Copy the entire app war, explode it, deploy it (and of course
> recompile the requested jsp),
> all that just to check, say, that a typo in the view was corrected or
> that some cell contents are now correctly aligned?
>
> > On a half-way fast pc it  will last 10 seconds (depending on the size of
> > the webapp of course,
>
> That's just about what it last on my pc. It seems overkilling for
> checking tiny changes in jsps to me.
>
> Anyway, the documentation I referred from my previous post seems to
> suggest that the task is able to deploy the app without copying it
> (not to mention without "waring" it).
>
> Best regards,
> Carlos
>
>
>
> On 1/4/07, Leon Rosenberg <ro...@googlemail.com> wrote:
> > 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 <ca...@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
> >
> >
>
> ---------------------------------------------------------------------
> 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


Re: Deploy from ant

Posted by Carlos Pita <ca...@gmail.com>.
> Why not just drop in the new war file created from the ant war task?
> Tomcat will reload the app automatically.

Copy the entire app war, explode it, deploy it (and of course
recompile the requested jsp),
all that just to check, say, that a typo in the view was corrected or
that some cell contents are now correctly aligned?

> On a half-way fast pc it  will last 10 seconds (depending on the size of
> the webapp of course,

That's just about what it last on my pc. It seems overkilling for
checking tiny changes in jsps to me.

Anyway, the documentation I referred from my previous post seems to
suggest that the task is able to deploy the app without copying it
(not to mention without "waring" it).

Best regards,
Carlos



On 1/4/07, Leon Rosenberg <ro...@googlemail.com> wrote:
> 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 <ca...@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
>
>

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


Re: Deploy from ant

Posted by Leon Rosenberg <ro...@googlemail.com>.
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 <ca...@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