tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carlos Pita" <carlosjosep...@gmail.com>
Subject Re: Deploy from ant
Date Thu, 04 Jan 2007 21:49:16 GMT
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 <rosenberg.leon@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 <carlosjosepita@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 <rosenberg.leon@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 <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
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > 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


Mime
View raw message