maven工程依賴的jar包,在本地倉庫有,但是pom.xml文件卻報錯找不到jar包


啟動項目eclipse報錯:

嚴重: Error configuring application listener of class org.jeecgframework.web.system.listener.InitListener
java.lang.ClassNotFoundException: org.jeecgframework.web.system.listener.InitListener

然后發現是pom.xml有多處錯誤,提示缺少工件之類的,但是本地倉庫確有

Missing artifact org.jeecgframework.p3:jeecg-p3-biz-mail:jar:1.0.0

中文:

缺少工件org.jeecgframework.p3:jeecg-p3-biz-mail:jar:1.0.0

 

如題:maven工程出現找不到依賴的jar包錯誤,但是本地倉庫中有改如何解決。

現有兩種解決方法:

第一種:

    在eclipse中的window->show view->other->maven Repositories打開maven Repositories視圖,

    然后在maven Repositories視圖中選中local Repositories->Local Repository, 右鍵選擇Rebuild Index;

第二種:

    在找到錯誤中的jar包所在本地路徑,找到與jar包同文件夾下的_remote.repositories,

    刪除_remote.repositories文件 或者修改>XX=為>=(即刪除main,當然main也可能是其他值);

    然后再右鍵工程maven->update project;
 

親測用第二種方法已解決。


免責聲明!

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



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