基于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. $parsers & $formatters

    一.理解 $parsers 和 $formatters Angular 是MVVM框架,model层数据变化了会通知view层更新,同样的view层更新了也会通知到model $parsers 和 $ ...

  2. 自制微擎AI面相识别算术阈值

    有时在朋友圈或其他地方会看到一些AI面相的分享链接或小程序,不是面相算命的有多吸引人,而是前面有"AI"两个字母.于是我就上网找了一下相关代码,发现了一个微擎系统的面相模块.下载下 ...

  3. 使用composer命令加载vendor中的第三方类库

    1.首先下载需要的第三方类库,放在TP框架下的vendor文件夹下 2.给第三方类库SDK写上命名空间,命名空间为该类库的文件夹对应的名字 3.在composer.json文件中添加需要加载的第三方类 ...

  4. SpringBoot2.x搭建Eureka

    1 说明 全部配置基于1.8.0_111 当前SpringBoot使用2.0.5 2 创建项目 在SpringBoot项目生成器中,输入Group和Artifact,如下配置: 3 pom.xml配置 ...

  5. xshell链接ubuntu16

    用xshell 链接 ubuntu16 失败 ,是因为没有装 ssh 服务 sudo apt-get install openssh-server         //安装ssh服务 ps -ef | ...

  6. Linux基础学习之基础命令(1)--2019-11-14

    查看命令路径其他方法: which 命令: which [options] [--] programname [...] -a:显示所有匹配的程序文件,而非第一个: --skip-alias:略过别名 ...

  7. 2019年杭电多校第一场 1004题Vacation(HDU6581+数学)

    题目链接 传送门 题意 有\(n+1\)辆车要过红绿灯,告诉你车的长度.与红绿灯的起点(题目假设红绿灯始终为绿).车的最大速度,问你第\(0\)辆车(距离最远)车头到达红绿灯起点的时间是多少(每辆车最 ...

  8. Win10系统如何关闭自动更新?

    现在很多电脑的系统都升级到了win10了,win10已经渐渐普及到每个人的电脑中,但是,win10系统有一个功能特别讨人厌,我自认为挺讨厌这个功能的,它就是“自动更新”功能,你可能会说,自动更新不是挺 ...

  9. graylog-docker安装

    Graylog安装(docker) 1.安装docker jdk1.8 2.下载docker镜像 docker pull mongo docker pull docker.elastic.co/ela ...

  10. 团队项目评审&课程学习总结

    一:实验名称:团队项目评审&课程学习总结 二:实验目的与要求 (1)掌握软件项目评审会流程: (2)反思总结课程学习内容. 三:实验步骤 任务一:按照团队项目结对评审名单,由项目组扮演乙方,结 ...