1、新建maven工程
2、添加依赖
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.cs</groupId>
<artifactId>xmlssm</artifactId>
<version>1.0-SNAPSHOT</version>
<!--war包部署-->
<packaging>war</packaging>
<dependencies>
<!--添加springmvc依赖-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.1.6.RELEASE</version>
</dependency>
</dependencies>
<build>
<plugins>
<!--tomcat插件启动-->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7