1. 程式人生 > 實用技巧 >解決Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central

解決Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central

刪除了Maven預設的.m2/repository,IDEA裡面Maven設定了新的local_repository,專案報錯:找不到clean、resources等生命週期的外掛。

試了好多方法,比如setting.xml檔案新增阿里源,也沒用。後來親測,對我有效的一種解決方式:

  1. 先把local_repository倉庫裡org/apache/maven/plugins裡所有外掛的.lastupdated檔案刪掉,再點選專案右鍵,Maven-> Reload project
  2. 在File → setting下的 Maven → Importing ,加下面的一句話,該配置用於忽略ssl證書的驗證:

-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true

在這裡插入圖片圖片描述 參考文章與圖片來源:https://www.freesion.com/article/7311912251/

  1. IDEA右上角的Maven 工具欄,點選Reload All Maven Projects,就可以看到正在下載生命週期外掛了。