新建Maven工程,pom.xml报错web.xml is missing and <failOnMissingWebXml> is set to true

错误原因: 项目中没有web.xml

解决办法:

  1.  在项目中添加web.xml
  2. 在pom.xml中添加下面的插件
 1  <build>
 2   <plugins>
 3    <plugin>
 4     <groupId>org.apache.maven.plugins</groupId>
 5     <artifactId>maven-war-plugin</artifactId>
 6     <version>2.6</version>
 7     <configuration>
 8      <failOnMissingWebXml>false</failOnMissingWebXml>
 9     </configuration>
10    </plugin>
11   </plugins>
12  </build>

 

posted @ 2018-09-18 13:15  MrWang1994  阅读(215)  评论(0编辑  收藏  举报