新建Maven工程,pom.xml报错web.xml is missing and <failOnMissingWebXml> is set to true
错误原因: 项目中没有web.xml
解决办法:
- 在项目中添加web.xml
- 在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>