简体   繁体   English

很慢 Maven

[英]Very Slow Maven

C:\eclipse\workspace>mvn --version
Apache Maven 3.5.2 
Maven home: C:\apache\maven\bin\..
Java version: 1.7.0_65, vendor: Oracle Corporation
Java home: C:\Java\jdk1.7.0_65\jre
Default locale: en_US, platform encoding: Cp1252

C:\eclipse\workspace>mvn archetype:generate
[INFO] Scanning for projects...
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.4/maven-install-plugin-2.4.pom
Progress (1): 6.4 kB

Maven is very slow on my computer. Maven 在我的电脑上速度很慢。 I executed mvn archetype:generate and it's sitting at this point for 15 minutes.我执行了mvn archetype:generate并在此时等待了 15 分钟。 My inte.net connection is fast.我的 inte.net 连接很快。 I can download a large library from the inte.net in short time.我可以在短时间内从 inte.net 下载一个大型库。

Can anyone suggest a solution?谁能提出解决方案?

Since maven does not work well at slow internet connection, local proxy and cache maybe good idea.由于 maven 在互联网连接速度较慢时不能很好地工作,因此本地代理和缓存可能是个好主意。

Repocache is remarkable. Repocache非常出色。

Add repocache.cfg添加 repocache.cfg

[mvn.upstream.apache]
url = https://repo.maven.apache.org/maven2
This will cache package at mvn/releases.

Change $HOME/.m2/settings.xml add:更改 $HOME/.m2/settings.xml 添加:

<repository>
  <id>apache</id>
  <url>http://127.0.0.1:5000/mvn/apache</url>
</repository>

This worked for me.这对我有用。

The problem may be a lost.network disk connection.问题可能是网络磁盘连接丢失。 I had a similar issue.我有一个类似的问题。 And after dropping the not available.network disk, it started to work normally.并且在删除not available.network磁盘后,它开始正常工作。 More about this Slow maven unit tests有关此慢速 maven 单元测试的更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM