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

随笔- 46  文章- 2  评论- 45 

解决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.

      Deployment Assembly跟java版本不匹配

 

解决方案:

在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> </prof
复制代码

2、使用Eclipse自动Maven插件更新jar包失败(Nexus仓库配置都正常),提示如下错误:
[INFO] Scanning for projects...
[INFO] 
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]                                                                         

猜你喜欢

转载自blog.csdn.net/wangshuminjava/article/details/80510178