新想法建maven项目时速度缓慢的解决方法

  

  

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

  

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

  

默认为远程的,即从

  

http://repo1.maven.org/maven2/archetype-catalog.xml路径下载archetype-catalog.xml文件。

  

http://repo1.maven.org/maven2/archetype-catalog.xml文件约为3-4M,下载速度很慢,导致创建过程卡住。

  

  

1。在下面界面添加一个属性,内部archetypeCatalog=

  

新概念建maven项目时速度缓慢的解决方法

  

2。指定-DarchetypeCatalog为内部,即可使用maven默认的archetype-catalog.xml,而不用再远程下载。

  

。点击Configue→设置

  

新概念建maven项目时速度缓慢的解决方法

  

B。如下VM选项配置-DarchetypeCatalog=内部:

  

PS:注意右上角的灰字:对于默认的项目,而不是为
  当前项目

  

新概念建maven项目时速度缓慢的解决方法

  

3。mvn命令创建项目时

  

mvn原型:生成-DarchetypeCatalog=internal ,,

  

以上这篇新概念建maven项目时速度缓慢的解决方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。

新想法建maven项目时速度缓慢的解决方法