MAVEN build Project Slow problem solving

Source: Internet
Author: User

MAVEN projects can be very slow at the time of building artifacts, Since Maven every time the creation of the time to go back to download the Arthetype-catalog.xml file, and, now this file is larger, is close to the size of 5M, so in the case of poor speed, the creation of the project will be very slow, so, the current solution is to download the file locally to save and then build the project , so much faster, local download needs to be configured after the current use of Mac OS, the later time will update the way under Windows, but, usually this way, and then after the windows of authentication.

Preparatory work:

(1) Download the file:

http://repo1.maven.org/maven2/archetype-catalog.xml
linux 或者 mac 可以使用命令 curl
http://repo1.maven.org/maven2/archetype-catalog.xml >> /data/archetype-catalog.xml进行下载

下载好之后,将文件复制到对应的 .m2/ 的路径下去,这个为maven默认的路径,或者放在idea工具配置的settings.xml对应的文件路径下,具体情况,待后面去确认,文件放置位置只有这两个地址。
参考博客:http://blog.csdn.net/wangwei_cq/article/details/7911730
该博客中也是有提到maven进行构建的时候会再.m2下创建一个
archetype-catalog.xml 这个文件,所以,只要指定这个文件即可。

(2) Modify the address configuration:

When using the MVN archetype:generate command, add-darchetypecatalog=local to replace the catalog.xml on the network

Refer to the blog: http://www.cnblogs.com/gmq-sh/p/4742698.html

  


就这样添加一个命令,加上前面使用到的catalog.xml文件配置,就可以使用本地下载好的文件了,这样感觉还是比较简单的

MAVEN build Project Slow problem solving

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.