maven问题maven-compiler-plugin:3.1

在POM配置Maven plugin提示错误“Plugin execution not covered by lifecycle configuration”的解决方案

eclipse在其POM文件的一处提示出错以下:html

Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (execution: default-compile, phase: compile)apache

这表示m2e在其执行maven的生命周期管理时没有定义该插件,因此提示出错,其实m2e对此是提供了扩展机制的,咱们能够经过以下操做来消除这个出错提示:app

1. 进入Window—>Preferences—>Maven配置,进入Lifecycle Mapping设置项,以下图:eclipse

   

   从上图能够看出m2e管理maven生命周期的文件名是lifecycle-mapping-metadata.xml,以及该文件的存放路径maven

2. 下一步咱们就要去相应路径修改lifecycle-mapping-metadata.xml文件,但会发现这个文件在上图中提示的位置并不存在,那么此时就post

以到eclipse的安装目录下的plugins下的org.eclipse.m2e.lifecyclemapping.defaults_xxxxxx.jar文件中找到该文件(以下图):url

 

经过解压软件能够发现lifecycle-mapping-metadata.xml文件的确在jar包中,把它从jar包中解压出来并放置到前图所示的路径下spa

3. 打开lifecycle-mapping-metadata.xml文件,把未识别的插件在文件中加入便可:插件

 

4.修改完成后,需在m2e配置处把“Update Maven projects on startup”选项勾上,并重启eclipse便可消除出错示。xml

文章源路径:https://www.cnblogs.com/hzhuxin/archive/2012/06/17/2552998.html