[英]Automating the Import of Existing Maven Project Into Eclipse
我正在為項目創建一個安裝程序,並希望在檢查項目后將現有的maven項目導入到我的eclipse工作區。
我將盡快得到任何幫助。
多謝你們!
我自動設置eclipse,包括導入現有的maven項目。
首先運行mvn eclipse:eclipse上的項目
mvn eclipse:eclipse:
接下來抓住一個eclipse插件,將項目無頭導入工作區:
wget https://github.com/snowch/test.myapp/raw/master/test.myapp_1.0.0.jar
將上面的jar復制到/eclipse/dropins/
文件夾。
接下來找到可以導入到eclipse中的所有目錄並使用'-import'附加它們
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
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.