http://blog.youkuaiyun.com/u010697681/article/details/50761184
这种错误是因为maven默认简单构建项目是sevlet3.0版本,web.xml不是必须的,这时候需要手动创建webapp/WEB-INF/web.xml,web.xml可以从其他项目复制一个过来改改,
或者pom.xml添加如下配置
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
修改完了别忘了右键项目Mavan/update project..
本文介绍了解决Maven项目中由于缺少web.xml文件导致的问题的方法。可以通过手动创建web.xml文件或在pom.xml中添加特定配置来解决这个问题。
202

被折叠的 条评论
为什么被折叠?



