不幸的是,由于 Artifact 下载,maven 初始构建非常慢
f.e.我尝试使用 curl 下载相同的 jar - 它快了 3 倍!!!
为什么?我怎样才能加快速度?也许 maven 有一些与 Artifact 下载速度相关的配置键?
谢谢。
最佳答案
我知道这是一个老问题,但从 Google 偶然发现了这里。我已经有代理,只需要加快并发下载速度。您可以使用 mvn 选项:
-Dmaven.artifact.threads=30
来源: https://maven.apache.org/guides/mini/guide-configuring-maven.html
Configuring Parallel Artifact Resolution
By default, Maven 2.1.0+ will download up to 5 artifacts (from different groups) at once. To change the size of the thread pool, start Maven using -Dmaven.artifact.threads. For example, to only download single artifacts at a time:
mvn -Dmaven.artifact.threads=1 verify
You may wish to set this option permanently, in which case you can use the MAVEN_OPTS environment variable. For example:
export MAVEN_OPTS=-Dmaven.artifact.threads=3
关于java - 是否可以加快 Maven Artifact 的下载速度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9974311/