One or more constraints have not been satisfied.

来源:互联网 发布:杜蕾斯锁精环 知乎 编辑:程序博客网 时间:2024/05/09 04:46

错误说明:eclipse+maven下Java Resoures资源文件夹出现小红叉。

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


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


解决方案:在pom中配置如下内容:

[java] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. <!-- 指定maven编译方式为jdk1.7版本 -->  
  2. <profiles>  
  3.     <profile>  
  4.         <id>jdk-1.7</id>  
  5.         <activation>  
  6.             <activeByDefault>true</activeByDefault>  
  7.             <jdk>1.7</jdk>  
  8.         </activation>  
  9.         <properties>  
  10.             <maven.compiler.source>1.7</maven.compiler.source>  
  11.             <maven.compiler.target>1.7</maven.compiler.target>  
  12.             <maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion>  
  13.         </properties>  
  14.     </profile>  
  15. </profiles>  


配置好以后,重新maven update Project...下就行了。
0 0
原创粉丝点击