Downloading Eclipse plug-in update sites for offline installation
Equinox p2 Repository Mirroring
今天在裝maven2eclipse時覺得太慢了,只能線上安裝,找不到離線包, 找尋很久後,發現可以按照上面的方式建立本地鏡像,然後再裝,那個速度杆杆的
下面是從上面大牛那裡看到的shell指令碼,儲存在檔案mirror_eclipse_p2_site.sh中,我選擇了使用cygwin來運行,也有window下的調用方法,但沒試過
#!/bin/shif [ $# -ne 2 ]; thenecho "Usage: $0 from to";exit 1;fieclipse_home=${eclipse_home:-/cygdrive/d/eclipse-jee-juno-win32-x86_64/eclipse}$eclipse_home/eclipse -application org.eclipse.equinox.p2.artifact.repository.mirrorApplication -source $1 -destination $2$eclipse_home/eclipse -application org.eclipse.equinox.p2.metadata.repository.mirrorApplication -source $1 -destination $2在cygwind中調用上面的命令檔案
sh mirror_eclipse_p2_site.sh http://download.eclipse.org/technology/m2e/releases/ file:/tmp/m2e_local_mirror/
因為網路較慢,這個命令執行的時間會比較長,要耐心等待,如果命令中斷,重新執行上面的命令就好,有點斷點續傳的意思,直到命令正常結束, 結果鏡像檔案夾總共大小有120多兆,裡麵包今了各個jar包的曆史版本 至此本地鏡像建立完成,使用eclipse下的Install New Software,輸入地址file:E:\tmp\m2eMirror - file:/E:/tmp/m2eMirror/,即可快速安裝