mvn archetype:generate 执行很慢的原因

mvn archetype:generate 执行很慢的原因

首先 执行分析

mvn -X archetype:generate

发现 执行获取 remote 的 archetype-catalog.xml 文件 会很慢
这里写图片描述

可以通过指定参数 -DarchetypeCatalog 的值来决定从哪里家在文件

archetypeCatalog 的值可选范围

The archetype catalogs to use to build a list and let the user choose from. It is a comma separated list of catalogs. Catalogs use the following schemes:

  • ‘file://…’ with archetype-catalog.xml automatically appended when pointing to a directory
  • ‘http://…’ or ‘https://…’ with archetype-catalog.xml always appended
  • ‘local’ which is the shortcut for ‘file://~/.m2/archetype-catalog.xml’
  • ‘remote’ which is the shortcut for Maven Central repository, ie ‘http://repo.maven.apache.org/maven2
  • ‘internal’ which is an internal catalog

将文件下载之后 放在 file://~/.m2/archetype-catalog.xml 这里
指定参数 -DarchetypeCatalog=local

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值