2014-09-23 47 views
2

我在Github中有一個Maven項目,我想在Eclipse中使用它。在eclipse中,有一個File> New> Other> Maven>從SCM檢出Maven項目的選項。但SCM URL附近的下拉選擇選項處於非活動狀態。點擊「m2e Marketplace」後,我在列表中找不到git。雖然我確實發現了egit,所以我試圖安裝它。但是我得到了下面的錯誤信息。試圖通過Git在Eclipse中打開Maven項目時出現問題Luna

An error occurred while collecting items to be installed 
session context was:(profile=epp.package.jee, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=). 
No repository found containing: osgi.bundle,org.eclipse.egit,3.4.1.201406201815-r 
No repository found containing: osgi.bundle,org.eclipse.egit.core,3.4.1.201406201815-r 
No repository found containing: osgi.bundle,org.eclipse.egit.doc,3.4.1.201406201815-r 
No repository found containing: osgi.bundle,org.eclipse.egit.ui,3.4.1.201406201815-r 
No repository found containing: osgi.bundle,org.eclipse.jgit,3.4.1.201406201815-r 
No repository found containing: osgi.bundle,org.eclipse.jgit.archive,3.4.1.201406201815-r 
No repository found containing: org.eclipse.update.feature,org.eclipse.egit,3.4.1.201406201815-r 
No repository found containing: org.eclipse.update.feature,org.eclipse.jgit,3.4.1.201406201815-r 

出了什麼問題?我可以使用egit而不是Git嗎?爲什麼我收到錯誤信息?對不起,是「m4e」下一代的「m2e」?

+0

爲什麼不做一個git克隆到一個文件夾,然後將其作爲maven項目導入? – Ernie 2014-09-23 12:21:01

+0

我試過了。但是出了點問題。不知道是什麼。 – Sreenadh 2014-09-24 05:52:04

回答

1

您使用的是哪個版本的Eclipse?

我猜你使用Java打包或Java EE打包。默認情況下,Egit已經存在於這兩個包中。

如果要使用「從SCM檢出Maven項目」選項,則需要安裝m2e連接器。您可以通過以下方式執行此操作:Windows>首選項> Maven>發現>打開目錄。並安裝m2e-egit。主要問題是m2e-egit並不總是最新的。將它安裝在Eclipse中是不可能的。

Personnally,我不使用這個功能。我更喜歡通過Egit來檢查我的源代碼,並且在導入我的Maven項目之後。

要結賬來源 - 打開Git的角度 - 克隆你的Github上庫(見拉爾斯沃格爾製作教程http://www.vogella.com/tutorials/EclipseGit/article.html

**要導入Maven項目** - 轉到文件>導入>現有Maven Project - 選擇您的Git存儲庫所在的文件夾 - 按照嚮導

您的項目將在Eclipse中導入。

相關問題