我在我的项目上尝试了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中的代理设置,我觉得这是问题所在。但我尝试了相同的代理设置来构建其他开源软件项目,并且构建成功。但对于这个项目,我看到了这个错误。
有人可以就这个问题提出想法。
答案 0 :(得分:5)
(来源:Maven Confluence)
当Maven无法下载依赖项时,通常会发生此错误。导致此错误的可能原因是:
${user.home}/.m2/settings.xml
的声明。<server>
包含<id>
声明,其<id>
与要使用的远程存储库的-U
匹配。有关详细信息,请参阅Maven Settings Reference。LocalRepositoryNotAccessibleException
。如果出现与网络相关的一般问题,您还可以参考以下文章:
答案 1 :(得分:1)
您的远程存储库都有域maven.apps.com
,是您Intranet中的域吗? Nexus是否作为Maven中心的镜像运行?
如果没有,您可以尝试暂时删除settings.xml并查看默认设置是否成功。
答案 2 :(得分:1)
我遇到了这个问题,maven无法下载任何内容。经过一些谷歌搜索和一些运气,我删除了文件〜/ .m2 / server.xml。这解决了问题。我之前没有碰过那个文件,不知道问题是什么。
答案 3 :(得分:0)
我遇到了同样的问题,结果我的 settings.xml 文件位于 c:.m2\ 文件夹中。一旦我将它移到用户个人资料下,它就会像魅力一样工作。 也许是因为位置相关。