java - Maven 全新安装失败,连接超时 :connect error

标签 java maven-2 pom.xml connection-timeout

我在我的项目上尝试了 maven clean install,但每次出现以下错误

Maven 版本 2.2.1 JDK 1.7

F:\Wealth>"C:\Program Files\apache-maven-2.2.1\bin\mvn.bat" cl
ean install -U
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building polo
[INFO]    task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
Downloading: http://maven.apps.com/maven2/org/apache/maven/plugins/maven-cle
an-plugin/2.2/maven-clean-plugin-2.2.pom
[WARNING] Unable to get resource 'org.apache.maven.plugins:maven-clean-plugin:pom:2.2' from repository nunki (http://maven.apps.com/maven2): Error transferring file: Connection timed out: connect
Downloading: http://maven.apps.com/maven/org.apache.maven.plugins/poms/maven
-clean-plugin-2.2.pom
[WARNING] Unable to get resource 'org.apache.maven.plugins:maven-clean-plugin:pom:2.2' from repository nunki-legacy (http://maven.apps.com/maven): Error transferring file: Connection timed out: connect
Downloading: http://maven.apps.com/maven2//org/apache/maven/plugins/maven-clean-plugin/2.2/maven-clean-plugin-2.2.pom
[WARNING] Unable to get resource 'org.apache.maven.plugins:maven-clean-plugin:pom:2.2' from repository central (http://repo1.maven.org/maven2): Error transferring file: Connection timed out: connect
Downloading: http://maven.apps.com/maven2/org/apache/maven/plugins/maven-cle
an-plugin/2.2/maven-clean-plugin-2.2.pom
[WARNING] Unable to get resource 'org.apache.maven.plugins:maven-clean-plugin:pom:2.2' from repository nunki (http://maven.apps.com/maven2): Error transferring file: Connection timed out: connect
Downloading: http://maven.apps.com/maven/org.apache.maven.plugins/poms/maven
-clean-plugin-2.2.pom
[WARNING] Unable to get resource 'org.apache.maven.plugins:maven-clean-plugin:pom:2.2' from repository nunki-legacy (http://maven.apps.com/maven): Error transferring file: Connection timed out: connect
Downloading: http://maven.apps.com/maven2//org/apache/maven/plugins/maven-cl
ean-plugin/2.2/maven-clean-plugin-2.2.pom
[WARNING] Unable to get resource 'org.apache.maven.plugins:maven-clean-plugin:pom:2.2' from repository central (http://repo1.maven.org/maven2): Error transferring file: Connection timed out: connect
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).


Project ID: org.apache.maven.plugins:maven-clean-plugin

Reason: POM 'org.apache.maven.plugins:maven-clean-plugin' not found in repository: Unable to download the artifact from any repository

  org.apache.maven.plugins:maven-clean-plugin:pom:2.2

from the specified remote repositories:
  nunki-legacy (http://maven.apps.com/maven),
  central (http://maven.apps.com/maven2/),
  nunki (http://maven.apps.com/maven2)

 for project org.apache.maven.plugins:maven-clean-plugin

我检查了 settings.xml 中的代理设置,我觉得这就是问题所在。但是我尝试了相同的代理设置来构建其他开源软件项目并且构建成功。但是对于这个项目,我看到了这个错误。

谁能对这个问题给出一个想法。

最佳答案

依赖解析异常

(来源:Maven Confluence)

这个错误一般发生在Maven无法下载依赖的时候。此错误的可能原因是:

  1. POM 遗漏了 <repository> 的声明托管工件。
  2. 您配置的存储库需要身份验证,而 Maven 未能向服务器提供正确的凭据。在这种情况下,请确保您的 ${user.home}/.m2/settings.xml包含 <server>声明其<id>匹配<id>要使用的远程存储库。查看Maven Settings Reference了解更多详情。
  3. 有问题的远程存储库使用 SSL,而运行 Maven 的 JVM 不信任服务器的证书。
  4. 存在阻止 Maven 访问任何远程存储库的一般网络问题,例如缺少代理配置。
  5. 您已将 Maven 配置为执行严格的校验和验证,但要下载的文件已损坏。
  6. Maven 无法将文件保存到您的本地存储库,请参阅 LocalRepositoryNotAccessibleException 了解更多详情。
  7. 在 Maven 3 中,如果您刚刚下载失败并已修复它(例如,通过将 jar 上传到存储库),它将缓存失败。要强制刷新,请添加 -U到命令行。

如果是一般的网络相关问题,您还可以引用以下文章:

关于java - Maven 全新安装失败,连接超时 :connect error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28725195/

相关文章:

java - 如何让多个球从顶部落下?

java - 为 Android 项目选择 ORM(最低 API 级别 7)

java - 如何在具有不同分辨率的 RCP 应用程序中的 View 中设置独立 View 的高度?

java - Maven 没有正确选择 JAVA_HOME

maven - 如何在 Intellij Idea 中找出未使用的依赖项 Maven

java - 如何使用 aspectj-maven-plugin

maven-2 - 如何将 Gradle 项目发布到范围为 'optional' 和 'provided' 的 Maven 存储库?

maven-2 - 如何阻止 Maven 重命名已安装的 jar

java - 为什么从 maven2 迁移到 buildr 时我的测试无法运行?

maven - Maven编译-错误log4j