美文网首页
JDK1.8 解决MavenOne or more constr

JDK1.8 解决MavenOne or more constr

作者: ShawnCaffeine | 来源:发表于2019-03-29 22:36 被阅读0次

解决eclipse+MAVEN提示One or more constraints have not been satisfied.的问题

应用版本:eclipse luna4.4.1

JDK:1.8

Maven:3.2.5

问题现象:

1、编译工程后总该是显示下面两个错误:

One or more constraints have not been satisfied.

解决方案:

在pom.xml中添加下面内容即可,同时也可以解决Maven->update project默认jdk的问题

  <profiles>
    <profile>
        <id>jdk-1.8</id>
        <!-- 另外一种激活方式 -->
        <activation>
            <activeByDefault>true</activeByDefault>
            <jdk>1.8</jdk>
        </activation>
        <properties>
            <maven.compiler.source>1.8</maven.compiler.source>
            <maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
        </properties>
    </profile>
</profiles>

相关文章

网友评论

      本文标题:JDK1.8 解决MavenOne or more constr

      本文链接:https://www.haomeiwen.com/subject/tfldbqtx.html