在配置maven的pom.xml的时候会出现这样的错误:
web.xml is missing and <failOnMissingWebXml> is set to true
解决:
这样的情况一般是没有web.xml造成的,所以添加上web.xml就可以了。
添加方法:右键项目 - J2EE Tools - generat deployment descriptor stub
但是如果不是web项目那么怎么办? 那就需要在pom.xml中这样配置:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
然后你会发现问题解决了!