2013年7月29日 星期一

Eclipse (Juno/Kepler) Maven, M2E and EGit 相容性問題解法


話說Eclipse 的特色就是他有很多的Plugin可以使用(算是使用OSGI架構的最成功案例),但是最讓人詬病的地方偏偏也就是plugin 相依性的問題(真是成也蕭何敗也蕭何),因為plugin種類太多,版本演進太快,所以常常會有各個plugin 版本衝突無法使用的問題。這次要解決的問題就使用Maven + EGit 所產生的問題,這個問題從Juno 版本就出現,但是到Kepler版本都還沒有解決,真是讓人失望。

問題是這樣產生的:
當我們使用Eclipse Import 的功能時,可以選擇Check out Maven Project from SCM


預設SCM type 是空的,必須要透過右下角m2e Marketplace 安裝SCM Connectiors




但是從Juno 版開始,不管是選擇egit或是subclipse都會出現這樣的錯誤:

Cannot complete the install because one or more required items could not be found.
Missing requirement:Maven SCM Handler for EGit




上網查了一下參考[1]的文章,原來是m2e marketplace 上支援的connector 版本跟EGit不相容....=_=

所以解決方法如下:

1. 點選Eclipse 上方 Menu的 Help
2. 選擇Install New Software
    (記得 Uncheck  Group items by category 的選項,這樣等下才看的到安裝內容)
3. 按Add 輸入以下URL (選擇0.14.0的最新版本0.14.0.201305250025)


     http://repository.tesla.io:8081/nexus/content/sites/m2e.extras/m2eclipse-egit/0.14.0/N/0.14.0.201305250025/




4. 按下確定後安裝

這樣Maven + Egit 就可以正常使用了





Reference:
[1] Eclipse Juno, Maven, M2E and EGit Compatibility Problem and Solution

沒有留言 :