java - 是否可以加快 Maven Artifact 的下载速度?

标签 java maven

不幸的是,由于 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/

相关文章:

java - 如何将 README.md 复制到 src/main/resources 中?

java - SpringBoot完全可执行的jar,内部没有依赖

java - 是否可以逐渐使用 iText RTF(Java 库)刷新输出? (内存不足错误)

java - 如何验证 JUnit 测试中抛出的异常的详细信息?

java - 数据库查询插入无法正常工作

java - 设置 M2_HOME

java - 使用 hibernate 以两个列表作为参数从数据库获取对象

java - 在 Java 中将 String 转换为 Long 的正确方法

java - 如何解决Maven对MongoDB的依赖

hibernate 空间 : "No Dialect mapping for JDBC type: 3000"