Is it possible to speed up maven artifacts downloading?

后端 未结 5 1245
刺人心
刺人心 2021-01-04 01:16

Unfortunately the maven initial build is very slow due to artifacts downloading
f.e. I\'ve tried to download the same jar using curl - it is 3 times faster!!!
Why? A

5条回答
  •  囚心锁ツ
    2021-01-04 02:02

    You can download artifact using curl (if you think that is faster) and install it to your maven repository using following command:

    mvn install:install-file -Dfile= -DgroupId= \
        -DartifactId= -Dversion= -Dpackaging=
    

    http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html

    Once you install it in local repository, next time maven will pick it up from there and will not try to download again.

    Additionally, if the central maven repository site is slower to you, please consider using Maven Repository Mirrors.

    Guide to Mirror Settings - http://maven.apache.org/guides/mini/guide-mirror-settings.html

提交回复
热议问题