基于maven的项目,使用各种maven plugin来完成开发中的各种工作,例如编译代码,打包,部署等等… 每个plugin包含许多的goal,用来做特定的事情。典型的基于java的maven项目就有 clean compile test package deploy等goal要执行。除了这些比较常见的goal之外,项目中还可以使用大量的第三方的plugin,甚至自己动手开发的plugin。

随之而来的问题是,在eclipse中编辑maven项目的时候,eclipse并不知道这些goal要做什么,通用的goal还好说,特殊用途的goal就没有办法了。所以m2eclipse这个集成maven到eclipse的plugin就提供了开发extra的能力,eclipse利用这些extra来完成本来在maven plugin要干的活。

如果eclipse没有办法知道某个goal要干什么,那么通常就会看到如下的错误信息:

Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-dependency-plugin:2.6:copy (execution: default, phase: validate)

参考这里http://wiki.eclipse.org/M2E_plugin_execution_not_covered 之后,要做的就是告诉eclipse要忽略的goal,我认为在workspace的层面忽略比较合适,这个本身就是编辑器层次的问题,和项目无关,所以如果放在pom中感觉怪怪的。由于我个人更倾向于在命令行下让maven干活,而eclipse更多的只是充当编辑器的角色,所以我要的只是让eclipse忽略掉这些goal就好了。

首先安装最新版本的m2eclipse (1.2 ver),update side是 http://download.eclipse.org/technology/m2e/releases 因为m2eclipse已经交给eclipse来维护了,所以之前的那个(http://download.eclipse.org/technology/m2e/releases),已经不更新了。

安装完之后,我们来忽略上面的那个错误,它的意思是eclipse不知道 maven-dependency-plugin 里面的 goal:copy 我没有办法执行 :) 要忽略这个goal,打开 eclipse->preference->maven->lifecycle mappings,打开 lifecycle-mapping-metadata.xml 文件,将如下内容替换进去:

lifecycle-mapping-metadata.xml

<?xml version="1.0" encoding="UTF-8" ?>

<lifecycleMappingMetadata>

    <pluginExecutions>

        <pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<versionRange>[2.6, )</versionRange>
<goals>
<goal>copy</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution> </pluginExecutions> </lifecycleMappingMetadata>

然后执行一下Project Update,那个错误就消失了

http://ljhzzyx.blog.163.com/blog/static/383803122013440345857/

解决'maven lifecycle mapping not converted'的问题的更多相关文章

  1. Maven教程(3)--Maven导入工程常见问题(编码、MavenArchiver、Lifecycle Mapping、maven install 没有反应)

    常见错误: 常见错误一:These projects must be migrated to correctly function in this version of MyEclipse 需要修改编 ...

  2. 16)maven lifecycle

    http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html http://maven.apache.o ...

  3. Cannot read lifecycle mapping metadata for artifact org.apache.maven.plugins问题的解决

    今天换了个maven仓库,结果新建maven工程的时候,忽然报错: Cannot read lifecycle mapping metadata for artifact org.apache.mav ...

  4. 【待解决】maven创建web报Cannot read lifecycle mapping metadata for artifact org.apache.maven.plugins

    Cannot read lifecycle mapping metadata for artifact org.apache.maven.plugins:maven-war-plugin:maven- ...

  5. win10 pro eclipse maven: Cannot read lifecycle mapping metadata for artifact org.apache.maven.plugins:mav invalid END header (bad central directory offset)

    Error:Cannot read lifecycle mapping metadata for artifact org.apache.maven.plugins:mav ... invalid E ...

  6. [转]解决Maven报错"Plugin execution not covered by lifecycle configuration"

    [转]解决Maven报错"Plugin execution not covered by lifecycle configuration" 导入Myabtis源码后,POM文件会报 ...

  7. maven创建web报错Cannot read lifecycle mapping metadata for artifact org.apache.maven.plugins:maven-compiler-plugin:maven-compiler-plugin:3.5.1:runtime Cause: error in opening zip file

    Cannot read lifecycle mapping metadata for artifact org.apache.maven.plugins:maven-compiler-plugin:m ...

  8. Cannot read lifecycle mapping metadata for artifact org.apache.maven.plugins:mav问题

    1.导致问题原因:从装系统,从win7改到win10 由于重装了系统,打开eclipse时,maven验证会出错,点击pom文件,会发现有红色的Cannot read lifecycle mappin ...

  9. 解决Maven出现Plugin execution not covered by lifecycle configuration 错误

    http://blog.163.com/xh_ding/blog/static/1939032892015222368827/ 解决Maven出现Plugin execution not covere ...

随机推荐

  1. Socket-网络服务提供的一种机制

    网络编程 网络通信的要素 Ip,端口,协议(tcp/udp) 127.0.0.1 本机地址   默认主机名:localhost   端口号:用于标识进程的逻辑地址. 有效端口:0-65535   其中 ...

  2. Mac OS 查看端口和杀死进程

    查看sudo lsof -i:port (端口号) sudo lsof -i:9501 COMMAND PID USER FD TYPE DEVICESIZE/OFF NODE NAME php 77 ...

  3. getResourceAsStream的路径问题

    1.Class类的getResourceAsStream this.getClass().getResourceAsStream("/resource.properties"); ...

  4. Linux无法免密登录的原因

    一.免密登录的方法 下面操作是把/root/.ssh/id_dsa.pub文件内容追加到192.168.7.100系统中的/root/.ssh/authorized_keys文件中 # 创建并发送密钥 ...

  5. Linux必知必会--awk

    弱者,是没有资格要求公平的. --<秦时明月>卫庄 参考文献: http://www.ruanyifeng.com/blog/2018/11/awk.html 阮一峰 https://ww ...

  6. Pushing Boxes(广度优先搜索)

    题目传送门 首先说明我这个代码和lyd的有点不同:可能更加复杂 既然要求以箱子步数为第一关键字,人的步数为第二关键字,那么我们可以想先找到箱子的最短路径.但单单找到箱子的最短路肯定不行啊,因为有时候不 ...

  7. wordpress如何防止url被篡改

    一位网友反馈说他的wordpress网站经常被篡改url,访问网站直接跳到不相关的页面,只能进入数据库那修改wp_option表中修改homeurl字段才能恢复.如果不知道原理就只能恢复数据库甚至重新 ...

  8. How do I fix "selector not recognized" runtime exceptions when trying to use category methods from a static library?

    https://developer.apple.com/library/content/qa/qa1490/_index.html A: If you're seeing a "select ...

  9. hdu1010-Tempter of the Bone-(dfs+奇偶剪枝)

    http://acm.hdu.edu.cn/showproblem.php?pid=1010 翻译:有只狗被困了,S是起点,D是门,W是墙不能走,‘ . ’是可以走的路,走一次就会在1秒内坍塌,也就是 ...

  10. 学习:Windows API核心DLL文件

    在 Windows 的系统目录中,存在着很多的动态链接库文件(DLL 文件).这些 DLL 文件中包括了 Windows API 函数可执行程序. DLL 将各函数"导出",这样应 ...