tamingtext / book

Taming Text Book Source Code
http://www.tamingtext.com
380 stars 207 forks source link

"mvn clean package" very slow artifact download speeds #17

Closed sujitpal closed 10 years ago

sujitpal commented 10 years ago

The repositories hosting various components seem to be awfully slow. Here is a sample of some of the download speeds being reported by "mvn clean package":

Downloaded: http://repo.maven.apache.org/maven2/org/apache/ant/ant-junit/1.7.1/ant-junit-1.7.1.pom (4 KB at 0.2 KB/sec) Downloaded: http://repo.maven.apache.org/maven2/org/apache/ant/ant-parent/1.7.1/ant-parent-1.7.1.pom (5 KB at 0.3 KB/sec) Downloaded: http://repo.maven.apache.org/maven2/org/apache/ant/ant/1.7.1/ant-1.7.1.pom (10 KB at 0.6 KB/sec)

Its not my network, I checked. Network speeds tested using speedtest-cli: Download: 24.57 Mbit/s Upload: 10.10 Mbit/s

so it appears that download speed is being throttled on the server side. Looking inside the pom.xml showed that the maven2 repo was pointing at this URL:

http://people.apache.org/maven-snapshot-repository

which probably works, but is not backed up with enough hardware compared to http://repo1.maven.org/maven2/ (which is the central maven2 repo based on this web page (http://www.mkyong.com/maven/where-is-maven-central-repository/).

After switching the url and rerunning "mvn clean package", the download speeds are significantly higher.

Downloaded: http://repo1.maven.org/maven2/org/codehaus/jackson/jackson-mapper-asl/1.4.0/jackson-mapper-asl-1.4.0.pom (2 KB at 15.4 KB/sec) Downloaded: http://repo1.maven.org/maven2/com/googlecode/json-simple/json-simple/1.1/json-simple-1.1.pom (2 KB at 19.6 KB/sec)

While in the pom.xml, also noticed that the sf.net repository configured for OpenNLP. Nowadays OpenNLP is also available on maven central, so both repository definitions identified by the ids below can be safely removed from the pom.xml, and will result in much faster setup.

opennlp
  <id>apache.maven2.snapshot.repository</id>

Still takes upwards of an hour to run the command to completion. You may want to mention that in the README.

drewfarris commented 10 years ago

Fixed on taming-text-1_0-branch - no alternate maven repositories needed.

sujitpal commented 10 years ago

Thanks! Just wanted to circle back with feedback - removing the entire repositories block like you did in the commit makes the "mvn clean package" command return in about 3 minutes on my box (with a clean ~/.m2/repository).