天天看點

eclipse從git上clone java maven項目

背景

因為項目開發工具不同,是以在把代碼送出到git時是不能把工具屬性送出的,如eclipse的

.project

檔案,idea的

.iml

檔案。那麼在導出項目的時候就要注意了,idea會自動識别,但是eclipse如果操作不當,就會出現項目不可用,自動代碼提示時報【

This compilation unit is not on the build path of java project

】的錯誤。

Git的項目如下

eclipse從git上clone java maven項目

Java項目常用配置(已配則忽略)

導入eclipse

打開eclipse,File -》 Import,選Git -》Projects from Git,點【Next】

eclipse從git上clone java maven項目

選【Clone URI】,點【Next】

eclipse從git上clone java maven項目

輸入URI,User, Password,這些都是對應git的賬号密碼,點【Next】

eclipse從git上clone java maven項目

選擇分支,點【Next】

eclipse從git上clone java maven項目

選擇項目儲存路徑,點【Next】

eclipse從git上clone java maven項目

這個界面點【Cancel】

eclipse從git上clone java maven項目

點【File】-【Import】-【Maven】,選【Existing Maven Projects】,點【Next】

eclipse從git上clone java maven項目

選擇上面從Git上Clone出來的項目,點【Finish】即可

eclipse從git上clone java maven項目

導出完畢,結果如下

eclipse從git上clone java maven項目