解决maven使用archetype模板创建项目速度很慢的问题(使用idea)

原因:
IDEA根据maven archetype的本质,其实是执行mvn archetype:generate命令,该命令执行时,需要指定一个archetype-catalog.xml文件。

该命令的参数-DarchetypeCatalog,可选值为:remote,internal ,local等,用来指定archetype-catalog.xml文件从哪里获取。
remote——指向Maven中央仓库的Catalog
internal——maven-archetype-plugin内置的
local——本地的,位置为~/.m2/archetype-catalog.xml
默认为remote,即从 http://repo1.maven.org/maven2/archetype-catalog.xml路径下载archetype-catalog.xml文件。

解决方案一:

在创建Maven项目时加上 archetypeCatalog=internal 参数,如下:

这里写图片描述

解决方案二:

在maven的VM Options加上 :

-DarchetypeCatalog=internal

前面的横杆也是要的

这里写图片描述

参考:https://www.jb51.net/article/129031.htm

猜你喜欢

转载自blog.csdn.net/fighting_sxw/article/details/80850955