maven项目提示web.xml is missing或红色感叹号
This is a maven error. It says that it is expecting a web.xml file in your project because it is a web application, as indicated by <packaging>war</packaging>. However, for recent web applications a web.xml file is totally optional. Maven needs to catch up to this convention. Add this to your maven pom.xml to let maven catch up and you don\’t need to add a useless web.xml to your project:
大意是说这是一个Maven错误,在最近的web应用开发中web.xml文件已经变得可有可无了。不过Maven还没有跟上这一变化。
- <properties>
- <failOnMissingWebXml>false</failOnMissingWebXml>
- </properties>
2、红色感叹号,build path无报错
1)项目右键,maven download sources
2)项目右键,maven update project
3)项目右键,run as maven clean
4)project clean 选中报错项目 clean
如果以上步骤仍然无效,可在Problems视图查看具体错误,
Description Resource Path Location Type
Archive for required library: \’D:/DevTools/mavenrepo/org/apache/lucene/lucene-backward-codecs/5.5.4/lucene-backward-codecs-5.5.4.jar\’ in project \’test\’ cannot be read or is not a valid ZIP file test Build path Build Path Problem
在Maven仓库中查看,发现该jar包已存在,删除之,随便修改pom.xml使其重新编译,重新下载后正常。