IDEA 創建 MAVEN 項目卡在 Generating project in Batch mode。是 MAVEN 一直在請求:
http://repo1.maven.org/maven2/archetype-catalog.xml
這個項目目錄的 xml 文件,由於牆的問題,加載緩慢,等待時間十分漫長。
解決方法:修改 setting.xml 文件,把 mirror 改成阿里的鏡像。
1、打開 maven 目錄下的 conf/setting.xml,注意要是 idea 使用的 maven。
2、搜索 <mirrors>;找到 <mirrors>。在 <mirrors> 節點下添加。
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
3、運行 MVN 命令的時候加上 -DarchetypeCatalog=local 這個參數。在 IDEA 中:
完成!