1. 程式人生 > >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"異常

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設定項,如下圖:

可以看出m2e管理maven生命週期的檔名是lifecycle-mapping-metadata.xml,以及該檔案的存放路徑。

          然後我們根據路徑去尋找這個檔案m2e管理maven生命週期的檔案,但是發現找不到,因此,我們需要到eclipse的安裝目錄下的plugins下,找到一個名字為"org.eclipse.m2e.lifecyclemapping.defaults_xxxxxx.jar"的jar檔案,使用解壓軟體開啟它,會發現lifecycle-mapping-metadata.xml檔案。如下圖

然後,把未識別的外掛在檔案中加入:如下圖

最後,我們需在m2e配置處把“Update Maven projects on startup”選項勾上,並重啟eclipse即可消除出錯示。如下圖