今日观看spring 实战第四版,想着实战实战,就是要动起来,不能光看不练,于是自己创建一个maven项目准备练习遇到此错误来记录一下
项目小红叉
POM.XML 抛错
网上查找相关资料,缺少web.xml,有两种解决方案
1、添加web.xml,看图:
点击右键,如图操作添加web.xml
2、方案二,就是给pom.xml 中添加一段配置,告诉maven 我不需要web.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>
方案二结束。
参考链接:
https://www.cnblogs.com/dongyu666/p/7079414.html
https://www.cnblogs.com/djoker/p/6679525.html