gpt4 book ai didi

Maven 依赖超时设置

转载 作者:行者123 更新时间:2023-12-04 02:58:47 25 4
gpt4 key购买 nike

Maven在下载依赖项时报告超时异常,因为它的默认超时是60000,但在我的情况下我需要增加因为(我工作的环境已经建立了一个中间服务器,首先将所有文件下载到它自己的服务器和我的机器从该中间服务器获取那些下载的文件)。
现在问题来了,如果依赖太大,仅仅需要超过 60000 毫秒,那么 eclipse 就会出现以下异常

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Arquillian Persistence Extension Aggregator
[INFO] Arquillian Persistence Extension API
[INFO] Arquillian Persistence Extension SPI
[INFO] Arquillian Persistence Extension Core
[INFO] Arquillian Persistence Extension DBUnit Integration
[INFO] Arquillian Persistence Extension Integration Tests
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Arquillian Persistence Extension Aggregator 1.0.0.Final-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-java-version) @ arquillian-persistence-parent ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven-version) @ arquillian-persistence-parent ---
[INFO]
[INFO] --- maven-dependency-plugin:2.3:unpack (unpack) @ arquillian-persistence-parent ---
[INFO] Configured Artifact: org.wildfly:wildfly-dist:8.0.0.Final:zip
Downloading: http://repo.maven.apache.org/maven2/org/wildfly/wildfly-dist/8.0.0.Final/wildfly-dist-8.0.0.Final.zip
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Arquillian Persistence Extension Aggregator ....... FAILURE [2:11.315s]
[INFO] Arquillian Persistence Extension API .............. SKIPPED
[INFO] Arquillian Persistence Extension SPI .............. SKIPPED
[INFO] Arquillian Persistence Extension Core ............. SKIPPED
[INFO] Arquillian Persistence Extension DBUnit Integration SKIPPED
[INFO] Arquillian Persistence Extension Integration Tests SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2:11.908s
[INFO] Finished at: Wed May 07 11:27:41 PKT 2014
[INFO] Final Memory: 22M/177M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.3:unpack (unpack) on project arquillian-persistence-parent: Unable to resolve artifa
ct. Could not transfer artifact org.wildfly:wildfly-dist:zip:8.0.0.Final from/to central (http://repo.maven.apache.org/maven2): No response received after 60000
[ERROR] org.wildfly:wildfly-dist:zip:8.0.0.Final
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR] central (http://repo.maven.apache.org/maven2, releases=true, snapshots=false)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

在 60000 之后没有收到响应,这条线会造成麻烦。

作为解决方案:

我正在使用 settings.xml 使用以下设置
<settings>
<servers>
<server>
<id>central</id>
<configuration>
<timeout>120000</timeout>
</configuration>
</server>
</servers>
</settings>

虽然我确定 settings.xml 的路径是正确的。

不幸的是它不起作用。

最佳答案

根据 this Maven guide有一种设置超时的新方法。
我换了 ~/settings.xml现在读起来是这样的......

<server>
<id>central</id>
<configuration>
<httpConfiguration>
<all>
<connectionTimeout>120000</connectionTimeout>
<readTimeout>120000</readTimeout>
</all>
</httpConfiguration>
</configuration>
</server>

它似乎在我的情况下工作。我尝试了一个不存在的存储库,当我将两个超时设置为 5000 时,它似乎比以前失败得更快。你能试一试吗?

关于Maven 依赖超时设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23510525/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com