主界面Import Project
選擇maven項目目錄文件夾
選擇Import project from external model 中的maven選項,Next下一步
Sources和Documentation默認好像是不勾選的,看自己
選擇Environment settings...,配置自己的maven版本和setting配置文件
注意:setting文件里要把本地倉庫的路徑配置好,就是這個<localRepository>/path/to/local/repo</localRepository>標簽
還有建議吧中央倉庫地址改成國內的比較好
我找到是阿里雲的
<mirror>
<id>nexus-aliyun</id>
<name>nexus-aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
<mirrorOf>central</mirrorOf>
</mirror>
把這個放到mirrors標簽里
----
記錄一下在哪里修改,時間久了自己都忘了
文件路徑為maven目錄下的conf文件夾里的settings.xml文件里
----
后面就是下一步再下一步,最后是Finish完成
這里父maven項目就導入成功
接下來是導入maven子項目
選擇項目設置Project Structure...選項
選擇modules
點擊+號
選擇import module
選擇maven子項目文件夾目錄
接下來就是重復maven父項目的操作就ok了
這里我參考了以下的博客
地址:
https://blog.csdn.net/programerxiaoer/article/details/78041681 這個是idea導入maven項目
https://blog.csdn.net/yyym520/article/details/77527976 這個是導入多個maven項目
https://blog.csdn.net/liu857279611/article/details/70156350 這個是Tomcat的xml配置