2013-06-26 111 views
3

我正在爲一個項目創建一個安裝程序,並且想在將項目檢出後將現有的maven項目導入到我的eclipse工作區中。自動將現有的Maven項目導入到Eclipse中

我會盡快得到任何幫助。

謝謝!

+1

請告訴我們您到目前爲止。你的問題是什麼。這不是有人爲你編碼的地方,我們只支持。 – philnate

回答

1

我自動設置eclipse,包括導入現有的maven項目。

首先運行mvn日食:日食對項目

mvn eclipse:eclipse: 

下一個搶一個Eclipse插件將執行項目的無頭導入到工作區:

wget https://github.com/snowch/test.myapp/raw/master/test.myapp_1.0.0.jar 

複製上述罐子你/eclipse/dropins/文件夾。

下一頁找到可以導入到Eclipse中的所有目錄,並以「 - 導入」

IMPORTS=$(find . -type f -name .project) 

# Although it is possible to import multiple directories with one 
# invocation of the test.myapp.App, this fails if one of the imports 
# was not successful. Using a for loop is slower, but more robust 
for item in ${IMPORTS[*]}; 
do 
    IMPORT="$(dirname $item)/" 
    echo "Importing ${IMPORT}" 

    # perform the import using the test.myapp_1.0.0.jar 
    eclipse -nosplash \ 
     -application test.myapp.App \ 
     -data $WORKSPACE \ 
     -import $IMPORT 
done 

最後,M2_REPO變量添加到工作區中添加他們

mvn eclipse:configure-workspace 
相關問題