m2eclipse错误
我正在使用 Eclipse 开发一个 Web 应用程序,并使用 Maven 原型生成该项目。
当我启用maven依赖管理时,Eclipse在pom文件中标记了一些错误,这个错误是:
Multiple annotations found at this line:
- Execution default-testResources of goal org.apache.maven.plugins:maven-resources- plugin:2.4.3:testResources failed:
Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to collect
dependencies for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3 () (org.apache.maven.plugins:maven-resources-
plugin:2.4.3:testResources:default-testResources:process-test-resources)
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile
(execution: default-compile, phase: compile)
- CoreException: Could not get the value for parameter compilerId for plugin execution default-compile:
PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one of its dependencies could not be
resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-compiler-plugin:jar:2.3.2 ():
ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.maven:maven-plugin-api:jar:2.0.6:
ArtifactResolutionException: Failure to transfer org.apache.maven:maven-plugin-api:pom:2.0.6 from http://repo1.maven.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:maven-plugin-api:pom:2.0.6 from/to central (http://
repo1.maven.org/maven2): null to http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-api/2.0.6/maven-plugin-
api-2.0.6.pom
- CoreException: Could not get the value for parameter compilerId for plugin execution default-testCompile:
PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one of its dependencies could not be
resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-compiler-plugin:jar:2.3.2 ():
ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.maven:maven-plugin-api:jar:2.0.6:
ArtifactResolutionException: Failure to transfer org.apache.maven:maven-plugin-api:pom:2.0.6 from http://repo1.maven.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:maven-plugin-api:pom:2.0.6 from/to central (http://
repo1.maven.org/maven2): null to http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-api/2.0.6/maven-plugin-
api-2.0.6.pom
- Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources failed: Plugin
org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to collect
dependencies for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3 () (org.apache.maven.plugins:maven-resources-
plugin:2.4.3:resources:default-resources:process-resources)
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:
2.3.2:testCompile (execution: default-testCompile, phase: test-compile)
我的pom文件如下:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.lala.sarasa</groupId>
<artifactId>msrdecision</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>msrdecision Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>hello</finalName>
</build>
</project>
Any idea?
I am developing a web application with Eclipse and I generate the project with a maven archetype.
When I enable maven dependency management, Eclipse mark some errors in the pom file, this error is:
Multiple annotations found at this line:
- Execution default-testResources of goal org.apache.maven.plugins:maven-resources- plugin:2.4.3:testResources failed:
Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to collect
dependencies for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3 () (org.apache.maven.plugins:maven-resources-
plugin:2.4.3:testResources:default-testResources:process-test-resources)
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile
(execution: default-compile, phase: compile)
- CoreException: Could not get the value for parameter compilerId for plugin execution default-compile:
PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one of its dependencies could not be
resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-compiler-plugin:jar:2.3.2 ():
ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.maven:maven-plugin-api:jar:2.0.6:
ArtifactResolutionException: Failure to transfer org.apache.maven:maven-plugin-api:pom:2.0.6 from http://repo1.maven.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:maven-plugin-api:pom:2.0.6 from/to central (http://
repo1.maven.org/maven2): null to http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-api/2.0.6/maven-plugin-
api-2.0.6.pom
- CoreException: Could not get the value for parameter compilerId for plugin execution default-testCompile:
PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one of its dependencies could not be
resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-compiler-plugin:jar:2.3.2 ():
ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.maven:maven-plugin-api:jar:2.0.6:
ArtifactResolutionException: Failure to transfer org.apache.maven:maven-plugin-api:pom:2.0.6 from http://repo1.maven.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:maven-plugin-api:pom:2.0.6 from/to central (http://
repo1.maven.org/maven2): null to http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-api/2.0.6/maven-plugin-
api-2.0.6.pom
- Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources failed: Plugin
org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to collect
dependencies for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3 () (org.apache.maven.plugins:maven-resources-
plugin:2.4.3:resources:default-resources:process-resources)
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:
2.3.2:testCompile (execution: default-testCompile, phase: test-compile)
My pom file is the following:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.lala.sarasa</groupId>
<artifactId>msrdecision</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>msrdecision Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>hello</finalName>
</build>
</project>
Any idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(17)
我正在使用 MacOSX 和 Eclipse 4.3 (Krepler)。我最初尝试的是使用 Brew 通过终端安装 Maven。它正确安装了 Maven 3.0.4。但是,当我尝试导入任何准备好的 Maven 项目(文件 > 导入 > Maven)时,它会显示以下两个错误:
我所做的是转到“帮助”>“ Eclipse Marketplace 并在搜索栏中输入“Maven”,然后安装 Eclipse 的第一个默认 Maven 客户端。从此时起,一切都对我有用。
希望它也对你有帮助。
I am using MacOSX with Eclipse 4.3 (Krepler). What I originally tried was to install Maven via the terminal using Brew. It installed correctly Maven 3.0.4. However when I tried to import any ready maven projects (File > Import > Maven) it would display the following two errors:
What I did is go to Help > Eclipse Marketplace and type "Maven" in the search bar and install the first default Maven client for Eclipse. Everything worked for me from this point.
Hope it helps to you too.
以下步骤对我有用:
这些步骤在 Eclipse Luna 中对我有用。如果我可以提供进一步的帮助,请告诉我。
The following steps worked for me:
These steps worked for me in Eclipse Luna. Please let me know if I can help further.
我的问题是 eclipse 在安装目录中找不到 mvn.bat 文件。解决方案是使用以下代码创建 mvn.bat 文件:
保存该文件。将其放在[Maven 安装文件夹]\bin 目录中。
My issue was that eclipse could not find the mvn.bat file within the installation directory. The solution is to create a mvn.bat file with the following code:
Save that file. Place it inside the [Maven Installation Folder]\bin directory.
我在 Eclipse 3.7.2 (Indigo) 和 Maven 3.0.4 上遇到了同样的问题。
就我而言,问题是由于
{user.home}\.m2\repository\org\apache\maven\plugins 中缺少
文件夹。 (不知道为什么 maven 没有更新它)maven-resources-plugin-2.4.3.jar
引起的\maven-resources-plugin\2.4.3解决方案:
1.) 添加对 pom.xml 的依赖项
2.) 从 Eclipse 或命令行运行
mvn install
3. ) 在 eclipse (F5) 中刷新项目
4.) 运行
Maven >更新项目配置...
项目(右键单击)JAR 文件已下载到本地存储库,并且 WS 中没有错误。
I had same problem with Eclipse 3.7.2 (Indigo) and maven 3.0.4.
In my case, the problem was caused by missing
maven-resources-plugin-2.4.3.jar
in{user.home}\.m2\repository\org\apache\maven\plugins\maven-resources-plugin\2.4.3
folder. (no idea why maven didn't update it)Solution:
1.) add dependency to pom.xml
2.) run
mvn install
from Eclipse or from command line3.) refresh the project in eclipse (F5)
4.) run
Maven > Update Project Configuration...
on project (right click)JAR file is downloaded to local repository and there are no errors in WS.
我在 Eclipse 3.7.2 (Indigo) 和 Maven 3.0.4 上也遇到了同样的问题。
Eclipse 没有获取我的 Maven 设置,所以我这样做是为了解决问题:
Window - Preferences - Maven - Installations
Maven> 更新项目配置...在项目上(右键单击)
关闭 Eclipse
从命令行运行
mvn install
。打开 Eclipse
这些步骤对我有用,但问题并不一致。我只在一台计算机上遇到过问题。
I also had same problem with Eclipse 3.7.2 (Indigo) and maven 3.0.4.
Eclipse wasn't picking up my maven settings, so this is what I did to fix the problem:
Window - Preferences - Maven - Installations
Maven > Update Project Configuration... on project (right click)
Shutdown Eclipse
Run
mvn install
from the command line.Open Eclipse
Those steps worked for me, but the problem isn't consistent. I've only had with issue on one computer.
只需转到您的用户文件夹,里面有一个“.m2”文件夹,打开它并删除文件夹“repository”。转到 eclipse,清理您的项目,然后右键单击 -> Maven -> Update Project .. 就可以开始了。
Just go to your user folder, inside it there's a ".m2" folder, open it and delete the folder "repository". Go to eclipse, clean your project, then right click->Maven->Update Project .. and you are ready to go.
我通过从命令行运行
mvn -U install
解决了这个问题,然后从 Eclipse 运行“Maven->Update Project”I solved this by running
mvn -U install
from command line and then "Maven->Update Project" from Eclipse在这种特殊情况下,解决方案是正确配置eclipse的代理(窗口->首选项->网络连接),该公司拥有严格的安全系统。我会留下这个问题,因为有一些答案可以帮助社区。非常感谢以上各位的解答。
In this particular case, the solution was the right proxy configuration of eclipse (Window -> Preferences -> Network Connection), the company possessed a strict security system. I will leave the question, because there are answers that can help the community. Thank you very much for the answers above.
就我而言,问题是通过 Window -> 解决的首选项-> Maven->用户设置->更新设置。我一开始并不知道问题的原因。
In my case the problem was solved by Window -> Preferences -> Maven -> User Settings -> Update Settings. I don't know the problem cause at the first place.
这对我有帮助:
.m
文件夹。删除其下面的repository
文件夹 (.m/repository)。祝你好运。
This what helped me:
.m
folder. Deleterepository
folder underneath it (.m/repository).Good luck.
我想添加一些帮助我解决这个问题的要点:
另一方面,拥有本地存储库OK结果证明成本相当高,因为许多原型无法加载,这显然是由于 m2eclipse 超时和我的情况下非常不稳定的通信速度。
在许多情况下,只能在文件夹 ex:
xxx.jar.lastUpdated
中找到错误文件,而不是 jar 或 pom 文件。我总是必须禁止该文件以允许新的下载。另外真正值得的是:
正如已经说过的,从命令行使用 mvn clean install,显然比 m2eclipse 更有耐心,而且也高效且冗长,至少目前是这样。
(以及Maven菜单的Update Project)
使用dependency:get goal下载
mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get -DrepoUrl=url -Dartifact=groupId:artifactId:version1
(来自项目文件夹内)(在另一个线程中给出的提示,也谢谢)。
还可以手动下载和安装 (.jar+.sha1),特别是从“m2proxy atlassian”。
在 pom.xml 本身中添加其他存储库(settings.xml 镜像配置没有完成这项工作,我还不知道为什么)。例如:nexus/content/repositories/releases/ et nexus/content/repositories/releases/、sousrepository.jboss.org、ou download.java.net/maven/2。
最后,无论如何,使用轻型工具直接彻底修复本地存储库肯定可以节省大量时间(!..)。我还没找到它。实际上它通常应该是一个 mvn 命令(“--repair-local-repository”)。
I would add some points that helped me to solve this problem :
Having the local repository OK, on the other hand, turned out to be quite costly, as many archetypes would not get loaded, due apparently to timeouts of m2eclipse and very unstable communication speeds in my case.
In many cases only the error file could be found in the folder ex :
xxx.jar.lastUpdated
, instead of the jar or pom file. I had always to suppress this file to permit a new download.Also really worthy were :
as already said, using the mvn clean install from the command line, apparently much more patient than m2eclipse, and also efficient and verbose, at least for the time being.
(and also the Update Project of the Maven menu)
downloading using the dependency:get goal
mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get -DrepoUrl=url -Dartifact=groupId:artifactId:version1
(from within the project folder) (hint given in another thread, thanks also).
also downloading and installing manually (.jar+.sha1), from in particular, "m2proxy atlassian" .
adding other repositories in the pom.xml itself (the settings.xml mirror configuration did'nt do the job, I don't know yet why). Ex : nexus/content/repositories/releases/ et nexus/content/repositories/releases/, sous repository.jboss.org, ou download.java.net/maven/2 .
To finish, in any case, a lot of time (!..) could have been et could certainly still be spared with a light tool repairing thoroughly the local repository straightaway. I could not yet find it. Actually it should even be normally a mvn command ("--repair-local-repository").
遇到了同样的问题。
就我而言,我在代理后面工作。
我的解决方案是
修改.m2文件夹中的settings.xml文件以添加代理配置。
代理人
真的
http
172.23.182.63
4145
在 Eclipse 中单击更新设置按钮。菜单:Windows>>首选项>>Maven>>用户设置
第 4 步之后 - eclipse 花了几分钟下载文件并成功刷新项目。
Encountered the same problem.
For my case i was working behind a proxy.
My solution was
Modify the settings.xml file in the .m2 folder to add the proxy configuration.
proxy
true
http
172.23.182.63
4145
In eclipse Click update settings button. Menu: Windows>>Preferences>>Maven>>User Settings
After step 4 - eclipse took a few minutes downloading files and project refreshed successfully.
一定是配置问题。你的 pom 没问题。
这就是我所做的。新建文件夹,把你的pom放进去。然后在eclipse中:导入->行家 ->现有的 Maven 项目。依赖项已包含在项目中。
我使用 eclipse helios 完成了此操作。我认为我使用的插件版本是 0.12
您应该检查 eclipse 中的 maven 属性。
It must be a configuration problem. Your pom is fine.
Here's what I did. New folder, put your pom inside. Then in eclipse: import -> maven -> existing maven project. Dependencies got included in the project.
I did this using eclipse helios. I think the plugin version I am using is 0.12
You should check the maven properties in eclipse.
这个错误困扰了我两天。我尝试了各种解决方案,但没有任何效果。最后我放弃了,尝试了一种激进的方法。成功了!步骤如下:
我猜它是“不确定的”,正如下面的文章所述。
http://wiki.eclipse.org/M2E_plugin_execution_not_covered
This error bothered me for two days. I tried all kinds of solutions, nothing worked. Finally I give up and tried a radical approach. and it worked! Here are the steps:
I guess it was "indeterministic" as the following article said.
http://wiki.eclipse.org/M2E_plugin_execution_not_covered
就我而言,有一个没有版本的依赖项。在 Eclipse 中,m2e 不会强制您输入版本,因此我将其留空。一旦我从 Eclipse 中将版本放入 pom.xml 中,一切都很好
in my case there was a dependency without a version. in eclipse m2e does not force you to enter a version so i left it blank. once i put the version in pom.xml from within eclipse all was fine
我对默认的groovy编译器插件有类似的情况解决
方案是根据这个答案安装Springsource提供的ME2
Pluginexecutionnotcoveredbylifecycleconfigurationmavenerror
这立即解决了 EclispeJuno 中的“Pluginexecutionnotcoveredbylifecycleconfiguration”问题。
I had a similar case for the default groovy compiler plugin
The solution was to install ME2 provided by Springsource according to this answer
Plugin execution not covered by lifecycle configuration maven error
This immediately solved the "Plugin execution not covered by lifecycle configuration" problem in Eclispe Juno.
我遇到了同样的问题,但有其他原因。解决方案是停用 Avira 浏览器保护(德语为 Browser-Schutz)。我从 m2e 无法传输元数据nexus,但是maven命令行可以。如果maven有需要的插件,可以再次激活它。
I had the same problem but with an other cause. The solution was to deactivate Avira Browser Protection (in german Browser-Schutz). I took the solusion from m2e cannot transfer metadata from nexus, but maven command line can. It can be activated again ones maven has the needed plugin.