CoreException: Could not get the value for parameter compilerId for plugin execution default-compile Maven項目pom文件報錯,插件引用不到


CoreException: Could not get the value for parameter compilerId for plugin execution default-compile: PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be resolved: The following artifacts could not be resolved: com.google.code.findbugs:jsr305:jar:2.0.1, org.codehaus.plexus:plexus-compiler-api:jar:2.2: Failure to transfer com.google.code.findbugs:jsr305:jar:2.0.1 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact com.google.code.findbugs:jsr305:jar:2.0.1 from/to central (http://repo.maven.apache.org/maven2): The operation was cancelled.

如何看到詳細的錯誤信息?

過程如下(這個問題不容易復現,應該是屬於偶然性的因網絡引起的問題):

雙擊打開有錯誤的pom.xml文件,Overview視圖,如下圖紅框標識的位置就會顯示錯誤信息,

鼠標左鍵單擊錯誤信息就會顯示出下圖所示的詳細信息,也可能是后邊標題為“Problems in the POM”對話框顯示的詳細信息

點擊如下圖所示的鏈接可以定位到POM文件對應的位置

網上有資料說是在“<build>”和“<plugins>”標簽之間添加“<pluginManagement>”,我加了也不起作用,但也沒有什么負作用

只怪自己英文太差,認真分析理解錯誤信息的意思,應該就是缺少對應的JAR文件,去配置的Maven本地“Repo”目錄下搜索

 

很明顯,缺少“plexus-compiler-api-2.2.jar”文件,由於網絡原因下載失敗了。

返回上一級目錄,刪除“2.2”文件夾。

修改“POM.xml”,隨便在空白處添加或刪除一個空格,保存文件,觸發更新事件!

可能由於相同的原因,導致多個包下載失敗或缺失,都使用相同的方法解決即可。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM