springboot项目没错,但就是报红叉

1.报错原因:

Description Resource Path Location Type
Cannot change version of project facet Dynamic Web Module to 2.5. sxnx-sms line 1 Maven Java EE Configuration Problem

解决方案:

在工程目录下(项目所在的那个位置) 有一个.settings文件夹(linux系统这个文件夹是隐藏的)打开org.eclipse.wst.common.project.facet.core.xml

做如下修改:

 <installed facet="jst.web" version="2.5"/>

2.

错误提示内容:One or more constraints have not been satisfied.

错误原因: Deployment Assembly跟java版本不匹配,即maven默认编译版本与使用的jdk不匹配。

解决方案:pom.xml文件中添加如下

<!-- 指定maven编译方式为jdk1.7版本 -->
<profiles>
<profile>
<id>jdk-1.7</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.7</jdk>
</activation>
<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion>
</properties>
</profile>
</profiles>

原文地址:https://www.cnblogs.com/curedfisher/p/11809831.html