How to Deploy a Maven Webapp to Tomcat
Assuming you have just installed and begun tomcat on your server, the time has come to deploy our basic Java web application to tomcat dedicated server. We simply need to configure few things and call a maven module and we will be up and running in the blink of an eye.
Open the <tomcat>/conf/tomcat-users.xml document after that enter the lines given below. On the off chance that there are as of now tomcat users characterized in the xml document then simply include the new role and user to the previous list.
<user username="administrator" password="administrator" roles="administrator,manager"/>
Presently we can get to the tomcat manager (http://localhost:8080 and hit "Tomcat Manager") with username administrator and password administrator.
We likewise now have the authorization to deploy applications to Tomcat Dedicated Server.
Open <maven>/conf/settings.xml after that enter the following lines to the <servers> list:
In Eclipse, open the pom.xml record and replace the current <build> with the accompanying:
What is the role of this plugin? Maven will download this plugin code at present, on the off chance that you don't as of now have it in your local repository. This module will arrange and deploy the application to tomcat. You don't have to do whatever else!
Accepting tomcat is now up and running enter the accompanying in TERMINAL:
$ cd MonsoonGreetings
$ mvn tomcat:deploy
At present you can open a web browser in your system with the url http://localhost:8080/MonsoonGreetings/
Open the document index.jsp in Eclipse and modify "Hi World!" to "Welcome to Monsoon Greetings!" and afterward redeploy in TERMINAL:
$ mvn tomcat:redeploy