但是, 也是卡的一批
第二种情况:
由于 achetype-catalog.xml 文件的访问问题, 导致了整个构建过程的缓慢, 所以是否能够将文件保存到本地, 成为一种解决思路. 翻阅 Maven 官方文档可以找到, 确实是可以的. 官方链接如下:
http://maven.apache.org/archetype/maven-archetype-plugin/specification/archetype-catalog.html
按照如下步骤:
1) 准备 archetype-catalog.xml 文件
方式 1: 通过浏览器查看 http://repo1.maven.org/maven2/archetype-catalog.xml 页源码, 复制到本地, 命名为 archetype-catalog.xml.
方式 2: 通过命令行 curl http://repo1.maven.org/maven2/archetype-catalog.xml> archetype-catalog.xml
2) 将上述文件放置到 maven 的默认路径下
注意, 这不是指的安装路径, 而是 mvn 运行时默认的存放 repository 的路径, 一般在用户根目录下的一个隐藏目录,~/.m2. 如果做过更改, 可以在 maven 的设置文件 setting.xml 中查看具体在哪个位置, 设置文件在 maven 安装目录 / config/settings.xml 中.
3) 在构建时, 在 archetype:generate 后加上 -DarchetypeCatalog=local 参数
来源: http://www.bubuko.com/infodetail-2610442.html