views:

37

answers:

2

I have Maven2 war project built, I'm using the cargo start plugin, and it works great for deploying the web app. To run the maven command, I use a .bat file in my workspace, and I have en external run config to run the the bat file. I can't seem to stop the server from the Eclipse console, or re-deploy.

Does anyone have any advice on how quickly start/stop/re-deploy to Tomcat locally while developing.

+1  A: 

Did you try JavaEE tools and m2eclipse? As far as I can see it should work well in most common situations. What m2eclipse does for you is to exactly map the maven configuration to an eclipse projects with the necessary facets set. Also, if the Dynamic Web Application facet is set for your project, you will be able to deploy it to a Tomcat server that you set up in the Server view of JavaEE tools. This configuration allows hot redeploy.

More information on JavaEE tools: http://eclipse.org/home/categories/index.php?category=enterprise

There is a full Eclipse distribution with the EE tools available on their download site: http://www.eclipse.org/downloads/

m2eclipse is freely available from Sonatype: http://m2eclipse.sonatype.org/

At work we use the mentioned software as well. Additionally we use the JBoss tools that provide a feature called Project Archives that let you individually build your web application archive (ear/war/...).

To get startet you should perhaps start a fresh workspace and import the existing maven project (via the import existing maven project wizard). If everything went fine you can set up your tomcat in the server view. Maybe switch to the Java EE perspective. Right click on the newly added server and select Add to add the dynamic web project you just imported. If it doesn't show up in the list try to update the project configuration via the project's maven context menu.

Andreas
+1  A: 

Well, you could use cargo:redeploy to Undeploy and deploy again a deployable (that's a shortcut to cargo:deployer-redeploy). But I personally don't use Cargo this way, I use it mostly for integration testing (i.e. during the build) and use Eclipse WTP during development (this works whether you're using the maven eclipse plugin or m2eclipse).

Pascal Thivent