admin管理员组

文章数量:1656733

maven创建一个项目的时候需要下载一个文件archetype-catalog.xml,

用idea创建maven项目时,idea会根据maven archetype的配置,执行mvn archetype:generate命令,该命令执行时,需要指定一个archetype-catalog.xml文件。

该命令的参数-DarchetypeCatalog,可选值为:remote,internal ,local等,用来指定archetype-catalog.xml文件从哪里获取。

默认为remote,即从 https://repo1.maven/maven2/archetype-catalog.xml路径下载archetype-catalog.xml文件。

https://repo1.maven/maven2/archetype-catalog.xml 文件约为10M,从maven中央仓库下载(在国外),就会导致下载速度很慢,从而创建过程经常会被卡住。

解决方案:下载一个文件archetype-catalog.xml到你的本地仓库根目录(文件下载在最后),你的仓库位置如图查看

然后把archetype-catalog.xml拉到你的仓库

然后在idea中按照下图设置-DarchetypeCatalog=local就🆗啦 

archetype-catalog.xml下载如下

 链接:https://pan.baidu/s/1WMS1yjuOUPd3nnoaGzCKRg 
提取码:wef0 
 

本文标签: 解决方案项目IDEAmavenweb