Failed to read artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:2.3.2

  categories:资料  author:

采用eclipse 的 Kepler Release 版本,创建maven后项目, 出现下面类似的错误信息

Description    Resource    Path    Location    Type
CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:2.3.2: ArtifactResolutionException: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:2.3.2 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-compiler-plugin:pom:2.3.2 from/to central (http://repo.maven.apache.org/maven2): null to http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/2.3.2/maven-compiler-plugin-2.3.2.pom    pom.xml    /test.mvn    line 1    Maven Project Build Lifecycle Mapping Problem

到google搜索有如下信息:

I have integrated Maven with Eclipse and trying to create a maven project. Every time i am trying to create project, its POM.xml shows error.

Multiple annotations found at this line: – Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (execution: default-compile, phase: compile) – Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile (execution: default-testCompile, phase: test-compile) – CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:2.3.2: ArtifactResolutionException: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:2.3.2 from htt:///repo.maven.apache.org/maven2 was cached in the local
repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-compiler-plugin:pom:2.3.2 from/to central (htt:///repo.maven.apache.org/maven2): null to htt://
repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/2.3.2/maven-compiler-plugin-2.3.2.pom

If I try to run maven-install or any of the maven run option. i get this error

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See htt://www.slf4j.org/codes.html#StaticLoggerBinder for further details. [INFO] Scanning for projects… [INFO]
[INFO] ———————————————————————— [INFO] Building CQ5 MyApp UI 0.0.1-SNAPSHOT [INFO] ———————————————————————— Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.pom [INFO] ———————————————————————— [INFO] BUILD FAILURE [INFO] ———————————————————————— [INFO] Total time: 12.289s [INFO] Finished at: Thu Mar 14 14:39:09 IST 2013 [INFO] Final Memory: 1M/15M [INFO] ———————————————————————— [ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.5 from/to central (htt://repo.maven.apache.org/maven2): null to htt://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.pom: UnresolvedAddressException -> [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

 

下面是解决办法:

  1. If you are working on windows like me, just go to C:\Users\Owner.m2\repository and delete all the files in it. Make sure to keep your eclipse close.
  2. Open eclipse and right click on your project, then click on Maven and then in Update Project. A dialog window appears, make sure to have selected ‘clean projects’ and ‘update project configuration from pom.xml’ options.

That should erase all the errors in the project. :)

 

采用上面的建议,

1. 首先关闭 eclipse

2. 删除repository 目录下全部东西

3. 启动eclipse

4. 在项目上选择maven菜单, 选择菜单中的 upate projec子菜单。 问题解决。



快乐成长 每天进步一点点