How to stop tomcat 7 with maven in eclipse

Débora picture Débora · Aug 31, 2014 · Viewed 7.4k times · Source

When I run my maven web project in eclipse. I go to pom.xml, right click on the file and
1. Maven Clean
2. Build Resources
3. Maven Build ..

Then I type tomcat7:run (for tomcat 7) for tomcat 6 , tomcat:run in the tomcat goals field in eclipse . It just starts. But I want to know how
1. To stop it
2. Rebuild the source and redeploy

in elipse or any other quick easy step. Isn't there any way to do all stuff to start the tomcat instead of repeating fore said steps(maven clean.. building resource.. again type tomcat7:run ... ) in eclipse.

Answer

Laurentiu picture Laurentiu · Aug 31, 2014

Can you try right click on pom.xml > Run As > Maven Build... Define here in the Goals section all your commands, something like: clean install tomcat7:run

My recommendation is to check skip tests for faster start up time, you can add extra paramenters like -Denvironment=qa if needed or VM arguments (from the JRE tab) like -Xmx2048m -Xms256m

Also, put a name to the configuration since you will be able to Run it again with a simple click or you could copy the .launch file eclipse generates into your application and commit it.

To stop the server just click the red square from the console view.

Hope it helps.