one or more constraints have not been satisfied

时间:2025-03-06 07:40:42

maven项目倒入后problem提示:one or more constraints have not been satisfied。


1、有可能是你的jdk版的过低了。如下

      <plugin>
   <groupId></groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>


 你的文件里的maven-compiler-plugin设置编译是1.6 ,但项目中的编译可能是1.7的,所有统一一下。




2、在你的文件下没有添加:

    <plugin>
    <groupId></groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>

     这句话所导致的,添加即可。