eclipse 插件 org.apache.maven.plugins:maven-resources-plugin:2.5 或其依赖项之一无法解析:UnresolvedAddressException
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15405385/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: UnresolvedAddressException
提问by rDX
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.
我已将 Maven 与 Eclipse 集成并尝试创建一个 Maven 项目。每次我尝试创建项目时,它的 POM.xml 都会显示错误。
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
在这一行发现多个注释: - 生命周期配置未涵盖插件执行:org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (execution: default-compile, phase: compile) - Plugin execution not生命周期配置涵盖:org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile(执行:default-testCompile,阶段:test-compile)-CoreException:无法计算构建计划:插件org.apache .maven.plugins:maven-compiler-plugin:2.3.2 或其依赖项之一无法解析:无法读取 org.apache.maven.plugins:maven-compiler-plugin:jar:2.3.2 的工件描述符: ArtifactResolutionException: 无法从 htt:///repo.maven.apache.org/maven2 传输 org.apache.maven.plugins:maven-compiler-plugin:pom:2.3.2 被缓存在本地
存储库,直到 central 的更新间隔已过或强制更新,才会重新尝试解析。原始错误:无法将工件 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
如果我尝试运行 maven-install 或任何 maven run 选项。我收到这个错误
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
SLF4J:无法加载类“org.slf4j.impl.StaticLoggerBinder”。SLF4J:默认为无操作 (NOP) 记录器实现 SLF4J:有关更多详细信息,请参见 htt://www.slf4j.org/codes.html#StaticLoggerBinder。[INFO] 正在扫描项目... [INFO]
[INFO] ----------------------------------- ------------------------------------- [信息] 构建 CQ5 MyApp UI 0.0.1-SNAPSHOT [信息] ------------------------------------------------ ------------------------ 下载:http: //repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-资源插件/2.5/maven-resources-plugin-2.5.pom5/maven-resources-plugin-2.5.pom: UnresolvedAddressException -> [Help 1] [ERROR] [ERROR] 要查看错误的完整堆栈跟踪,请使用 -e 开关重新运行 Maven。[错误] 使用 -X 开关重新运行 Maven 以启用完整的调试日志记录。[ERROR] [ERROR] 有关错误和可能的解决方案的更多信息,请阅读以下文章: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
What should I do?
我该怎么办?
回答by Nagaraja G Devadiga
- 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.
- 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.
- 如果您像我一样在 Windows 上工作,只需转到 C:\Users\Owner.m2\repository 并删除其中的所有文件。确保让你的日食靠近。
- 打开 eclipse 并右键单击您的项目,然后单击 Maven,然后单击更新项目。出现一个对话框窗口,确保选择了“清理项目”和“从 pom.xml 更新项目配置”选项。
That should erase all the errors in the project. :)
这应该清除项目中的所有错误。:)
回答by user4483023
You do not really have to delete everything from .m2\repository directory. Just the directories for 'problematic libraries', in your example YOUR_MAVEN_REPO.m2\repository\org\apache\maven\plugins\maven-compiler-plugin and delete 2.3.2 folder.
您实际上不必从 .m2\repository 目录中删除所有内容。只是“有问题的库”的目录,在您的示例中 YOUR_MAVEN_REPO.m2\repository\org\apache\maven\plugins\maven-compiler-plugin 并删除 2.3.2 文件夹。
Then right click on the project in Eclipse and Maven->Update Project. You will probably get a different error and you have to repeat the procedure. Do it 3-4 times and it should be fine...
然后在 Eclipse 和 Maven->Update Project 中右键单击该项目。您可能会遇到不同的错误,并且必须重复该过程。做3-4次应该没问题...
回答by rDX
Thank you all for you help and guidance. I got the error myself. I am in a proxy network and was required to set user id and password in settings.xml file of apache maven.
谢谢大家的帮助和指导。我自己得到了错误。我在代理网络中,需要在 apache maven 的 settings.xml 文件中设置用户 ID 和密码。
回答by Woodifer
Sounds like you may need to add the sl4j dependency in your pom file. See here: Failed to load class "org.slf4j.impl.StaticLoggerBinder"
听起来您可能需要在 pom 文件中添加 sl4j 依赖项。请参阅此处:无法加载类“org.slf4j.impl.StaticLoggerBinder”
Here is the depenedency from the dependency finder in CQ5.5:
这是 CQ5.5 中依赖项查找器的依赖项:
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.commons.log</artifactId>
<version>2.1.3-R1232904</version>
<scope>provided</scope>
</dependency>
Hope that helps and good luck.
希望有所帮助,祝你好运。