gpt4 book ai didi

Maven 连接重置错误

转载 作者:行者123 更新时间:2023-12-05 09:21:07 26 4
gpt4 key购买 nike

我在 linux 上有一个 maven 项目。直到上周,它的 build 都很好。今天我遇到了错误

[ERROR] Failed to execute goal on project my-integration-service: Could not resolve
dependencies for project com.mycompany.myproj:my-integration-service:jar:0.0.1-SNAPSHOT:
Failed to collect dependencies for [org.springframework:spring-core:jar:4.0.4.RELEASE
(compile), org.springframework:spring-tx:jar:4.0.4.RELEASE (compile), ...]: No versions
available for joda-time:joda-time:jar:[2.2,) within specified range -> [Help 1]

我检查了我的 settings.xml ,在本地存储库中我可以看到这个的许多版本...库 2.2、2.4 ... 2.9.1

我还看到了文件 M2_REPO/joda-time/joda-time/resolver-status.properties

maven-metadata-codehaus.xml.error=Could not transfer metadata joda-time\:joda-time/maven-metadata.xml from/to codehaus (http\://repository.codehaus.org/org/codehaus)\: Error transferring file\: repository.codehaus.org
...
maven-metadata-spring-milestone.xml.error=Could not transfer metadata joda-time\:joda-time/maven-metadata.xml from/to spring-milestone (http\://maven.springframework.org/milestone)\: Error transferring file\: Connection reset
....
maven-metadata-com.springsource.repository.maven.releases.xml.error=Could not transfer metadata joda-time\:joda-time/maven-metadata.xml from/to com.springsource.repository.maven.releases (http\://maven.springframework.org/release)\: Error transferring file\: Connection reset
...
maven-metadata-just-testing.xml.error=Could not transfer metadata joda-time\:joda-time/maven-metadata.xml from/to just-testing (http\://repo1.maven.org/maven2)\: Access denied to\: http\://repo1.maven.org/maven2/joda-time/joda-time/maven-metadata.xml
...
maven-metadata-apache.snapshots.xml.error=Could not transfer metadata joda-time\:joda-time/maven-metadata.xml from/to apache.snapshots (http\://repository.apache.org/snapshots/)\: Error transferring file\: Connection reset
...
maven-metadata-maven-restlet.xml.error=Could not transfer metadata joda-time\:joda-time/maven-metadata.xml from/to maven-restlet (http\://maven.restlet.org)\: Error transferring file\: Connection reset

我还按照建议运行了命令 mvn -X archetype:generate What could be causing 'error transferring file' in maven?

[WARNING] Error reading archetype catalog http://repo1.maven.org/maven2
org.apache.maven.wagon.TransferFailedException: Error transferring file: Connection reset
at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:143)
at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116)
at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)
....
....
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:196)
at java.net.SocketInputStream.read(SocketInputStream.java:122)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:687)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:633)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:658)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1323)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:115)
... 31 more
[WARNING] No archetype found in remote catalog. Defaulting to internal catalog
[DEBUG] Using catalog /wmchome/hfundadm/.m2/archetype-catalog.xml
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Choose archetype

不太确定会导致此错误的原因是什么?

  1. 任何端口被阻止?如果是,那么为什么只有 1 个文件出错?
  2. 不确定 local_repository 是否被忽略了?那里需要文件
  3. 列表项

使用 Apache Maven 3.0.3(r1075438;2011-02-28 12:31:09-0500)

<profile>
<id>defaultProfile</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>central</id>
<url>http://my-mvn-repo/repo</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://my-mvn-repo/repo</url>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
<properties>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</properties>
</profile>

但我没有看到任何带有 <id> 的服务器作为中心,有很多服务器......不确定正在使用哪一个

<server>
<id>abccommon_id</id>
<username>abccommon_adm</username>
<password>****</password>
</server>

最佳答案

我使用了以下标志,它成功下载了所有内容。

-Dhttps.protocols=TLSv1.2

关于Maven 连接重置错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34170811/

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