解決為什么每次打開Eclipse新的workspace需要更新nexus-maven-repository-index問題


解決為什么每次打開Eclipse新的workspace需要更新nexus-maven-repository-index問題

  1. 新建一個Eclipse的workspace。
  2. 打開Window—>Preferences,如下圖所示:
  3. 打開Preferences后,點擊Maven,可以看到右邊Maven下的Download repository index updates on startp。取消該項的勾選,點擊Apply后點擊OK即可。如下圖所示:
  1. 在之前已經有下載好的repository index 已有工作空間下,找到.metadata.pluginsorg.maven.ide.eclipsenexus。把該目錄下的 central文件夾整個復制到新建的workspace下對應 的.metadata.pluginsorg.maven.ide.eclipsenexus目錄下。替代原系統自動生成的central文件夾及其內 容。
  2. 完成以上步驟,下面我們來進行手動設置nexus-maven-repository-index更新。打開Eclipse的Window—>Show View—>Other…,如下圖所示:
  1. 打開后,找到Maven,點擊就可以看到Maven Indexes,選中點擊OK進入。如下圖所示:
  1. 下面就自動出現視圖窗口,里面應該有好三列記錄,分別是workspace, local和central,分別對應了該工程的java代碼,本地MAVEN庫和官方庫。如下圖所示:
  1. 選中local並點擊右鍵,會出現Update Index,點擊Update Index,即完成了手動更新nexus-maven-repository-index,不用再從遠程官方庫來下載了。

以上這些步驟就解決了每次新建一個工作空間,Eclipse自動從官方庫下載nexus-maven-repository-index的問題了。

First check all of your dependencies including plugins and children in the dependency tree,
try to replace snapshot versions with release versions,
as snapshot versions will always look for a later update, whereas
release versions are deemed to be stable and updates are not expected for the same version number.

Secondly, assuming that you are working on a LAN, I would suggest that you install a local maven repository manager such as Nexus, and then redirect your artifact requests by setting
<mirrorOf>*</mirrorOf> in your ${user.home}/.m2/settings.xml

This will enable your downloads to be resolved quickly against a local mirror, rather than continually checking against repositories on the internet.

http://stackoverflow.com/questions/5012567/why-does-eclipse-take-so-long-to-update-maven-dependencies


免責聲明!

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



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