Deploying web application on remote tomcat

I have Apache Tomcat 7.0.50 installed on my local machine and i wanted to create a Maven script that would deploy the web application to the locally installed Tomcat after deployment, these are the steps that i followed, if you want you can download the demo application from here
  • First i changed the <TOMCAT_HOME>/conf/tomcat-users.xml file to allow tomcat user to deploy web applications
  • Next i had to change the <USER_HOME>/.m2/settings.xml file to add server declaration pointing to Tomcat, in my case user who has rights to deploy application is tomcat so i did enter tomcat as user name and password
  • Last step is to change the pom.xml to add tomcat-maven-plugin plugin, this plugin takes URL of the tomcat server and the name of the server as defined in settings.xml (settings.xml has the actual username and password) as argument
  • Now you can run mvn tomcat:deploy or mvn tomcat:redeploy command to publish the web application to remote tomcat server

2 comments:

vanitharaj said...

Remote tomcat wonderful article.

Swords And Souls said...

Thanks for sharing the information. It is very useful for my future. keep sharing. Can you play more games at :
swords and souls | strike force kitty 2 | red ball 4 | ninjago games