当前位置: 首页 > news >正文

maven plugin的execution出错

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-dependency-plugin:2.7:copy... 错误如上,有介绍解决方法

org.eclipse.m2elifecycle-mapping1.0.0org.apache.maven.pluginsmaven-resources-plugin[2.0,)resourcestestResources

可这里的maven插件与我的不一样,又没讲清楚具体在哪里改动了。继续看,http://stackoverflow.com/questions/6352208/how-to-solve-plugin-execution-not-covered-by-lifecycle-configuration-for-sprin,这里貌似罗嗦了这个错误的原因, To solve some long-standing issues, m2e 1.0 requires explicit instructions what to do with all Maven plugins bound to "interesting" phases (see M2E interesting lifecycle phases) of project build lifecycle. We call these instructions "project build lifecycle mapping" or simply "lifecycle mapping" because they define how m2e maps information from project pom.xml file to Eclipse workspace project configuration and behaviour during Eclipse workspace build. Project build lifecycle mapping configuration can be specified in project pom.xml, contributed by Eclipse plugins and there is also default configuration for some commonly used Maven plugins shipped with m2e. We call these "lifecycle mapping metadata sources". m2e will create error marker like below for all plugin executions that do not have lifecycle mapping in any of the mapping metadata sources. Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-antrun-plugin:1.3:run   (execution: generate-sources-input, phase: generate-sources) m2e matches plugin executions to actions using combination of plugin groupId, artifactId, version range and goal. There are three basic actions that m2e can be instructed to do with a plugin execution --ignore, execute and delegate to a project configurator. 最终是这里提到了怎么解决 In my case of a similar problem, instead of using Andrew's suggestion for the fix, it worked simply after I introduced

tag to the pom.xml in question. Looks like that error is due to a missingtag. So, in order to avoid the exceptions in Eclipse, looks like one needs to simply enclose all the plugin tags inside atag, like so:..........我之前的结构是..........加上pluginManagement包裹起来后就没有这个错误了。      好吧,这个解决方法领导不满意,pluginManagement的作用是作为公用的插件配置项,给子项目共用的。这个项目没有子项目,这样处理不是很合理,领导最终找到另一种配置方式。去掉plugins标签外的pluginManagement包裹,在plugins的上层加一个pluginManagement,与原先的plugin平行,针对出问题的插件增加单独的配置,修改后的结构如下:.............pluginManagement内的详细配置如下:org.eclipse.m2elifecycle-mapping1.0.0org.apache.maven.pluginsmaven-dependency-plugin[0.0.0,)copy好吧,问题算是合理地解决了。可有人比额领导还纠结,说这个配置不该放在pom文件里,应该是ide来处理这个配置,就有了这个:http://liwenqiu.me/blog/2012/12/19/maven-lifecycle-mapping-not-converted/ 在eclipse->preference->maven->lifecycle mappings中,myeclipse的话Maven4MyEclipse->Lifecycle mappings,想上面所示进行配置,保存更新project。未试过eclipse下情况如何,MyEclipse默认配置路径是没有lifecycle-mapping-metadata.xml这个文件的,只有<项目名>.lifecyclemapping一系列这样的文件,但提供一个按钮“Open workspace lifecycle mappings metadata”里进行编辑。或者Change mapping file location。      好吧,这样也许是最应该的处理的方式,但让每个开发人员都改下ide配置,还不如直接改下pom.xml文件的配置,最终采用了修改pom.xml文件的方式。      好吧,最终还是将出错原因和解决思路抄一下: 基于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) 由于我个人更倾向于在命令行下让maven干活,而eclipse更多的只是充当编辑器的角色,所以我要的只是让eclipse忽略掉这些goal就好了。 参考这里http://wiki.eclipse.org/M2E_plugin_execution_not_covered 之后,要做的就是告诉eclipse要忽略的goal.

转载于:https://my.oschina.net/u/1455908/blog/209348

相关文章:

  • 自动在Web.config中生成连接字符串
  • DNS服务器系列之二:高级配置之-DNS子域授权、区域转发、acl列表及view
  • 解决ASP.NET程序上传到虚拟主机的问题
  • [爱情] 『转载』女生写的追MM秘籍,看了马上告别光棍
  • 物流配送管理自动化采用无线传输解决方案
  • 80后管理:难以理解 但无法回避
  • PHP安全配置
  • 又一套BlogEngine主题Andreas
  • SQL Server Mobile 和 .NET 数据访问接口之间的数据类型映射
  • JavaScript 经典代码大全
  • grep及正则表达式系列---02
  • ip default-network ip route 0.0.0.0 0.0.0.0
  • 在运算符重载++,--,+=,-=...
  • Firefox 高手设置大揭密
  • 每个人心中
  • node和express搭建代理服务器(源码)
  • PV统计优化设计
  • Redis 中的布隆过滤器
  • Vue 2.3、2.4 知识点小结
  • WordPress 获取当前文章下的所有附件/获取指定ID文章的附件(图片、文件、视频)...
  • 闭包--闭包之tab栏切换(四)
  • 给第三方使用接口的 URL 签名实现
  • 猫头鹰的深夜翻译:JDK9 NotNullOrElse方法
  • 前端设计模式
  • 如何设计一个微型分布式架构?
  • 算法-图和图算法
  • 微服务核心架构梳理
  • 中文输入法与React文本输入框的问题与解决方案
  • 追踪解析 FutureTask 源码
  • 阿里云ACE认证之理解CDN技术
  • #HarmonyOS:软件安装window和mac预览Hello World
  • #预处理和函数的对比以及条件编译
  • (13):Silverlight 2 数据与通信之WebRequest
  • (14)目标检测_SSD训练代码基于pytorch搭建代码
  • (20050108)又读《平凡的世界》
  • (3)Dubbo启动时qos-server can not bind localhost22222错误解决
  • (AtCoder Beginner Contest 340) -- F - S = 1 -- 题解
  • (篇九)MySQL常用内置函数
  • (一)ClickHouse 中的 `MaterializedMySQL` 数据库引擎的使用方法、设置、特性和限制。
  • (转)IOS中获取各种文件的目录路径的方法
  • (转)人的集合论——移山之道
  • .describe() python_Python-Win32com-Excel
  • .mkp勒索病毒解密方法|勒索病毒解决|勒索病毒恢复|数据库修复
  • .net core webapi 大文件上传到wwwroot文件夹
  • .Net MVC4 上传大文件,并保存表单
  • .NET MVC第三章、三种传值方式
  • .NET 服务 ServiceController
  • .Net 转战 Android 4.4 日常笔记(4)--按钮事件和国际化
  • .NET6使用MiniExcel根据数据源横向导出头部标题及数据
  • .Net调用Java编写的WebServices返回值为Null的解决方法(SoapUI工具测试有返回值)
  • .NET轻量级ORM组件Dapper葵花宝典
  • .pop ----remove 删除
  • .ui文件相关
  • @Conditional注解详解
  • @EnableConfigurationProperties注解使用