子模块Maven报Plugin execution not covered by lifecycle configuration

当在maven中,子模块依赖父maven项目时,发现在parent处有报错,如下


返回overview查看具体错误

Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check (execution: validate, phase: validate)



这是m2e在其执行maven的生命周期管理时没有定义该插件。具体解决如下

1、Windows->Preferences->Maven->Lifecycle Mappings


2、去找E:/github/designwp/.metadata/.plugins/org.eclipse.m2e.core/lifecycle-mapping-metadata.xml这个文件,发现在org.eclipse.m2e.core目录下并没有lifecycle-mapping-metadata.xml。

3、到eclipse安装目录plugins下找到org.eclipse.m2e.lifecyclemapping.defaults_*****.jar。解压


4、编辑lifecycle-mapping-metadata.xml,把报错提示中的plugin添加进来。

      org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check

     按冒号隔开,4个值分别是 groupId:artifactId:versionRange:goal

5、把编辑完之后的lifecycle-mapping-metadata.xml复制到第一步,即E:/github/designwp/.metadata/.plugins/org.eclipse.m2e.core目录下。

6、Update Maven projects on startup 勾上


7、重启eclipse,即可解除报错。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容