當建立maven工廠時沒有web.xml文件
1.點擊你的項目名稱,進入到Myeclipse的-- Project Facets上,
2.點擊Dynamic Web Module 和下面的Java,將兩個框選中java
3.點擊你右手邊的Runtimes裏的Tomcat,選中,而後點okweb
4.查看你的項目的target下面會多出一個WebRoot文件,你把裏面的文件複製到Src--Main--webapp下面apache
5.刪除你的WebRoot
6.點擊你的項目名稱,進入到Properties,點擊MyEclipse的Deployment Assemblyapp
7.刪除你的WebReoot,點擊add--Folder在src--main--webapp下面建立文件eclipse
8.點擊add添加java build path Entries 這樣你的maven文件就能夠正常運行了。webapp
若是遇到web.xml is missing and <failOnMissingWebXml> is set to true 直接複製上去maven
<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>SSH</groupId>
<artifactId>SSH</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<webVersion>3.1</webVersion>
</properties>
<plugs>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugs>
<build/>ui