Hot Deploy of development changes with Eclipse, Tomcat, and Jetspeed
I am developing a Je开发者_开发知识库tspeed portal application running on Tomcat, using the Eclipse IDE with the Sysdeo Tomcat launcher plugin to enable debugging of the application running in Tomcat/Jetspeed.
I was wondering how to enable hot deploy of development changes for this environment? Does anyone know how to configure a Jetspeed portal web application to be hot-deployed from Eclipse? Can't really find any information on the net for Jetspeed hot deployment.
I usually create an ant build file, loosely based on:
http://tomcat.apache.org/tomcat-6.0-doc/appdev/build.xml.txt
and use the 'install'/'remove' targets to deploy to a remote tomcat
Similar question here: Remote deploy Tomcat webapp from Eclipse
If you're talking about only developing on your local machine- you don't need an external plugin to eclipse, it has built in support for Tomcat and hot redeployment.
You might want to take a look at jrebel. I've been meaning to take a look myself - From my understanding, jrebel makes it possible to make source code changes and then be able to immediately see the results in a live environment (such as tomcat) without redeploying and/or restarting services.
From your question it is not entirely clear if you want to deploy your Jetspeed Portal project or a portlet application. The first is in fact a regular web application and theoretically can be hot-deployed using the Eclipse WTP plugin. If you are developing portlet applications, it is more complicated because they are not deployed to Tomcat directly, but to the Jetspeed deployement running in Tomcat (actual /webapps/jetspeed-portal/WEB-INF/deploy ).
A trick I used is deploying your application using your Maven build script. After that, you can copy the modifications made by tomcat to your web.xml of your portlet into your web.xml and deploy directly from Eclipse.
You can use the bult-in (in the Java EE version) Servers plugin:
- Go to Windows > Preferences > Server > Runtime environments and add your tomcat
- Either try using
publishing
, or use the FileSync plugin. There you can tell which folders from your project should be copied (live) to what directory on your machine (the tomcat/webapps/yourapp). With a little more effort the filesync configuration can be made machine independent (only using one parameter as TOMCAT_ROOT), in case you want to check-in the project to a repository where others will use it. - Start your tomcat in debug mode and you have hot-deploy of everything you save.
I'm aware that using the FileSync plugin is not generally accepted, and publishing
is the most common option, but FileSync gives you additional freedom to rearrange your classes and resources.
Obviously it is not the solution for all the cases, but a simple symbolic link will do the job for many cases, even in windows xp or windows 7, that now permit the creation of symbolic links.
My solution is depicted here
精彩评论