Using MAVEN's Tomcat plug-in in Eclipse to package the war package requires the following configuration in the Pom.xml file, which is the installation of the Tomcat plugin for MAVEN, which differs from the traditional packaging and deployment: the traditional installation of Tomcat locally The project is then deployed locally and the Tomcat plugin using MAVEN does not need to install Tomcat locally to run directly
With this configuration, you need to configure the output path after packaging, and packaging method, I hit the war package, so configured as follows:<outputdirectory> refers to the output path, if not configured, the default output to the target directory
Below you can click the Run as button to execute the Maven install command
The results are as follows
To see if there are qq.war packages in the corresponding path.
There is.
now running can be run directly using Tomcat7:run and the following operations :
The results are as follows:
Why the error, try a regular deployment, there is no problem, look at the wrong information, find the wrong location
It is clear that there is a jar package conflict:
With two Servlet_api jar packages, look at the hierarchical dependencies
Originally
Depends on the SERVLET-API, now remove it, need the following configuration
Use of the Maven Tomcat plugin