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

应用版本: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]                                                                        
[INFO] ------------------------------------------------------------------------
[INFO] Building  0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.apache.maven.plugins:maven-resources-plugin:jar:2.6 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.148 s
[INFO] Finished at: 2014-12-30T17:38:07+08:00
[INFO] Final Memory: 4M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failure to find org.apache.maven.plugins:maven-resources-plugin:jar:2.6 in http://localhost:8082/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
 huige 18:06:21
Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart:RELEASE from any of the configured repositories.

......

解决方案:

更新Maven包到最新版本即可(JDK1.8+Eclipse luna4.4.1搭配建议更新Maven到3.2.5版本之后)

preferences-》Maven-》Installations 选择最新的Maven地址

若转载请注明出处!若有疑问,请回复交流!
目录
相关文章
|
6月前
|
Java Maven Android开发
在Eclipse里配置Maven插件
Maven是一款比较常用的Java开发拓展包,它相当于一个全自动jar包管理器,会导入用户开发时需要使用的相应jar包。使用Maven开发Java程序,可以极大提升开发者的开发效率。下面我就跟大家介绍一下如何在Eclipse里安装和配置Maven插件。
145 0
|
2月前
|
Java Android开发
eclipse导入项目时,报错:One or more cycles were detected in the build path of project ....
eclipse导入项目时,报错:One or more cycles were detected in the build path of project ....
118 3
|
1月前
|
Java Maven Android开发
eclipse创建maven项目
本文介绍了在Eclipse中创建Maven项目的步骤,包括打开Eclipse、选择Java项目、完成项目创建以及自动下载插件的过程。
76 2
eclipse创建maven项目
|
5月前
|
Java Maven Android开发
eclipse更改maven的本地路径和外部仓库地址
eclipse更改maven的本地路径和外部仓库地址
252 1
|
5月前
|
Java Maven Android开发
杨校老师课堂基于SSM整合之用户登录案例【Eclipse - Maven版】2
杨校老师课堂基于SSM整合之用户登录案例【Eclipse - Maven版】
36 0
|
5月前
|
Java 应用服务中间件 Maven
杨校老师课堂基于SSM整合之用户登录案例【Eclipse - Maven版】1
杨校老师课堂基于SSM整合之用户登录案例【Eclipse - Maven版】
42 0
|
5月前
|
Java 应用服务中间件 API
eclipse创建 maven-web工程
eclipse创建 maven-web工程
|
11月前
|
Java Maven Android开发
在 Eclipse 中配置使用 Maven
在 Eclipse 中配置使用 Maven
159 0
|
12月前
|
Java 关系型数据库 Apache
Apache Maven简介&安装及系统坏境配置&eclipse配置Apache Maven---详细介绍
Apache Maven简介&安装及系统坏境配置&eclipse配置Apache Maven---详细介绍
152 0

推荐镜像

更多