简体   繁体   中英

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. I executed mvn archetype:generate and it's sitting at this point for 15 minutes. My inte.net connection is fast. I can download a large library from the inte.net in short time.

Can anyone suggest a solution?

Since maven does not work well at slow internet connection, local proxy and cache maybe good idea.

Repocache is remarkable.

Add 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:

<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. More about this Slow maven unit tests

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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