解决Maven Java EE Configuration Problem (2 items)报错问题
小编也是个刚学的小白,遇到问题,记录下来,同时也希望能帮到各位。我也翻阅了网上的解决办法,压根儿就解决不了,于是只有自己慢慢填坑了!
首先看看报错信息吧!
Maven Java EE Configuration Problem (2 items)
Dynamic Web Module 3.0 requires Java 1.6 or newer
One or more constraints have not been satisfied
解决步骤:
1、使用Navigator,显示.settings文件夹
2、修改文件org.eclipse.wst.common.component
3、修改org.eclipse.wst.common.project.facet.core.xml文件
3、修改文件org.eclipse.core.resources.prefs,将下列3行1.5改为对应版本
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.source=1.8
4、修改web.xml
5、修改编译:将1.5改为1.8
选中工程(右键) –> Properties –> Java Compiler
Java Compiler –> Building,将这两项Error改为Warning
6、在pom.xnl文件中添加如下代码
<!--
解决Maven Java EE Configuration Problem (2 items)报错问题
Dynamic Web Module 3.0 requires Java 1.6 or newer
One or more constraints have not been satisfied
-->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<!-- 指定source和target的版本 -->
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
7、更新Maven工程
工程(右键) -> Maven -> Update Project
很多网友说:要勾选 Force Update of Snapshots/Releases
8、然后红色叉叉消失