I have nothing to do today. I looked at the relevant materials of maven+tomcat and found that maven has made a simplified version of tomcat. All tomcat fans have good news.
<plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.0-beta-1</version> <configuration> <uriEncoding>utf-8</uriEncoding> <port>80</port> <path>/</path> </configuration> </plugin>
Put the above code into pom.xml, run tomcat:run and it's OK, isn't it very simple, no need to download tomcat, no need to configure tomcat.
Note: If there are servlet-api.jar, jsp-api.jar, el-api.jar in pom.xml, these three packages should be removed. tomcat comes with these 3 packages