Maven项目中xml文件一直显示红叉报错

在eclipse中写Maven项目时。经常会出现 .xml 文件报错的问题。
Multiple annotations found at this line:
- Referenced file contains errors (http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd). For more information, right click on the message
in the Problems View and select “Show Details…”
- Referenced file contains errors (http://www.springframework.org/schema/context/spring-context-4.2.xsd). For more information, right click on the
message in the Problems View and select "Show Deta

解决方案:
删除掉标签中 xsi:schemaLocation下的spring-context.xsd的版本号。
例如:spring-context-4.0.xsd 报错;改成spring-context.xsd
xsi:schemaLocation="
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

你可能感兴趣的:(Maven项目中xml文件一直显示红叉报错)