Eclipse中pom文件提示"CoreException:Could not get the value for parameter compilerId for plugin execu"异常

时间:2024-04-11 15:59:37

1、在pom文件中点击异常查看详细信息为:Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (execution: default-compile, phase: compile)

翻译过来是:生命周期配置未涵盖插件执行:org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile(执行:默认编译,阶段:编译)

2、解决方法

首先进入Eclipse,点击Window—>Preferences—>Maven—>Lifecycle Mapping,进入Lifecycle Mapping设置项,如下图:

Eclipse中pom文件提示"CoreException:Could not get the value for parameter compilerId for plugin execu"异常

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

          然后我们根据路径去寻找这个文件m2e管理maven生命周期的文件,但是发现找不到,因此,我们需要到eclipse的安装目录下的plugins下,找到一个名字为"org.eclipse.m2e.lifecyclemapping.defaults_xxxxxx.jar"的jar文件,使用解压软件打开它,会发现lifecycle-mapping-metadata.xml文件。如下图

Eclipse中pom文件提示"CoreException:Could not get the value for parameter compilerId for plugin execu"异常

Eclipse中pom文件提示"CoreException:Could not get the value for parameter compilerId for plugin execu"异常

然后,把未识别的插件在文件中加入:如下图

Eclipse中pom文件提示"CoreException:Could not get the value for parameter compilerId for plugin execu"异常

最后,我们需在m2e配置处把“Update Maven projects on startup”选项勾上,并重启eclipse即可消除出错示。如下图

Eclipse中pom文件提示"CoreException:Could not get the value for parameter compilerId for plugin execu"异常