I set up a small web project with JSF and Maven. Now I want to deploy on a Tomcat server. Is there a possibility to automate that like a button in Eclipse that automatically deploys the project to Tomcat?
I read about a the Maven War Plugin but I couldn’t find a tutorial how to integrate that into my process (eclipse/m2eclipse).
Can you link me to help or try to explain it. Thanks.
During development I recommend to use Eclipse Web Tools Platform (WTP). M2Eclipse provides support for it (assuming you have Maven Integration for WTP installed) and your project should be recognized as a Dynamic Web Project runnable on a Server.
So, declare Tomcat as a Server (show the Servers view and right-click in it to add a Server via New > Server). And deploy your project to it (right-click on your project then Run > Run on Server).
There are other options like using the
Tomcat Maven Pluginor the genericCargo Maven Pluginbut I wouldn’t use them for development and, since you are a Maven beginner, I don’t recommend them at all. Use your IDE.Actually, the Maven War Plugin is only responsible of the packaging of your webapp project (it is bound automatically on the
packagephase when using a<packaging>war<packaging>for your project). It isn’t used for deployment. But as I said, use your IDE to deploy your application during development.