How Maven implements automatic deployment in tomcat8
This article introduces how Maven implements automatic deployment in tomcat8 and shares it with you as follows:
1. First, you need to have Tomcat and configure users.
The configuration is located in Tomcat - users in the Tomcat config file XML file
Manager GUI and manger script are required, or 403 unauthorized error will be reported when uploading the war package.
2. Start Tomcat and enter the manager interface (enter the user name and password just configured)
In this way, the configuration of Tomcat is basically over. Here is how to configure Maven.
3. Create an empty webapp project with Maven.
mvn archetype:generate -DarchetypeCatalog=internal
Input configuration and so on (omitted HA)
4. Modify POM XML file
The main modification is the content in build. Pay attention to the content here http://localhost:8989/manager/text You need to change the path of your Tomcat manager.
5. Deploy the project in tomcat8
Using the plug-in MVN tomcat7: deploy
It should be noted that to enter and POM The XML file is in a folder at the same level.
6. Refresh the manager interface of Tomcat
Click to enter
7. At this time, modify the index JSP file
8. Redeployment
mvn clean tomcat7:undeploy tomcat7:deploy
9. Refresh the manager interface of Tomcat to enter the program
The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.