基于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. 22、vue实现随机四位数验证码

    效果图: 1.新建生成验证码的组件Sidentify.vue(代码如下): <template> <div class="s-canvas"> <ca ...

  2. 常用的本地存储-----cookie篇

    1.引言 随着浏览器的处理能力不断增强,越来越多的网站开始考虑将数据存储在「客户端」,那么久不得不谈本地存储了. 本地存储的好处: 一是避免取回数据前页面一片空白,如果不需要最新数据也可以减少向服务器 ...

  3. ffmpeg 详解

    来源:http://blog.itpub.net/9399028/viewspace-1242300/ FFMPEG详解   认识FFMPEG FFMPEG堪称自由软件中最完备的一套多媒体支持库,它几 ...

  4. NIO与网络编程系统化学习

    1.背景 数据在网络中传输,必然回遇到读写问题.... 2.比较NIO与IO 3.案例演示 3.1.缓冲区演示 package com.wfd360.nio; import org.junit.Tes ...

  5. python之路第四天

    2018年7月17日 python开发IDE: pycharm.eclipse        # 专业版    # 不要汉化 安装:去官网下载pycharm 注册:https://blog.csdn. ...

  6. 浅谈Python设计模式 - 代理模式

    声明:本系列文章主要参考<精通Python设计模式>一书,并且参考一些资料,结合自己的一些看法来总结而来. 一.在某些应用中,我们想要在访问某个对象之前执行一个或者多个重要的操作,例如,访 ...

  7. Linux系统的时间比北京时间慢12个小时的处理方案(将EDT时区改为CST)

    今天查看Linux操作系统的时间,发现比正常时间慢12个小时整,感觉很奇怪,后来使用ntp服务器校对时间发现也是不管用的,还是慢12个小时.之前遇到过是慢8个小时,但是我知道是因为使用的是UTC时间, ...

  8. zabbix--告警消息内容更改

    zabbix 告警消息内容更改 自带的消息内容模板发送出来的消息着实有点丑陋,再加之是英文,这就让我有点尴尬了. 如下默认的消息内容: 更改过后的效果: 操作步骤 编辑默认的Report proble ...

  9. pt-online-schema-change 最佳实践(转)

    pt的详细步骤 Step 1: Create the new table. Step 2: Alter the new, empty table. This should be very quick, ...

  10. asp.net中的参数传递:Context.Handler 的用法

    网上天天有人问怎么在webform页面之间传值,基本上来说,大家熟悉的是     (1)url字符串传值     (2)session传值     (3)直接读取server.transfer过来的页 ...