Deploying your web-application using the tomcat-maven-plugin can be done by as follows:
1. Create a user in Tomcat with the manager-script role. Before Tomcat 7.0, this was accomplished using the manager role. The user details can be sepecifed in the conf/tomcat-users.xml file as follows:
1. Create a user in Tomcat with the manager-script role. Before Tomcat 7.0, this was accomplished using the manager role. The user details can be sepecifed in the conf/tomcat-users.xml file as follows:
2. Now you need to tell maven that it can deploy applications to Tomcat using this role.
To set this connection, open your settings.xml file which should be present .m2 directory. Search for 'server' and put in the following credentials:
To set this connection, open your settings.xml file which should be present .m2 directory. Search for 'server' and put in the following credentials:
Obviously, the server name is :localhost in this case.localhost tom cat
3. In your maven pom.xml configure the tomcat-maven-plugin as follows:
Take note of the
org.codehaus.mojo tomcat-maven-plugin http://localhost:8080/manager/text localhost /project_context
Take note of the
This is important otherwise you will keep getting 403:Access Forbidded errors when you attempt to deploy.http://localhost:8080/manager/text
- To build you war and deploy on Tomcat, use : mvn tomcat:deploy
- To redploy your war, use : mvn tomcat:redeploy
- To undeploy your war, use : mvn tomcat:undeploy
0 comments:
Post a Comment