extends:http://www.cnblogs.com/gmq-sh/p/4742698.html ,http://www.cnblogs.com/rainy-shurun/p/5726758.html
(1)下載文件,下載地址:
http://repo1.maven.org/maven2/archetype-catalog.xml
linux 或者 mac 可以使用命令 curlhttp://repo1.maven.org/maven2/archetype-catalog.xml >> /data/archetype-catalog.xml進行下載
下載好之后,將文件復制到對應的 .m2/ 的路徑下去,這個為maven默認的路徑,或者放在idea工具配置的settings.xml對應的文件路徑下,具體情況,待后面去確認,文件放置位置只有這兩個地址。
參考博客:http://blog.csdn.net/wangwei_cq/article/details/7911730
該博客中也是有提到maven進行構建的時候會再.m2下創建一個archetype-catalog.xml 這個文件,所以,只要指定這個文件即可。
(2)修改地址配置:
- 直接下載archetype-catalog.xml文件,放到本地的apache-maven目錄中。
- 在使用mvn archetype:generate命令時,加上-DarchetypeCatalog=local,以替換網絡上的catalog.xml。