1、新建maven项目
右击左侧项目,new—》other—》Maven—》Maven Pro
2、添加tomcat,并加载包
右击项目—》build Path—》Configure Build Path
3、进入项目所在位置maven/.settings/org.eclipse.wst.common.project.facet.core.xml,更改java和jst.web
4、更改web.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1" metadata-complete="true">
</web-app>
5、修改pom.xml文件
在标签中添加
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
6、进行maven更新
右击项目—》Maven—》Update Project