Nexus不会从中心下载工件 [英] Nexus won't download artifacts from Central

查看:1448
本文介绍了Nexus不会从中心下载工件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在公司代理后安装了Nexus 2.2-01。 Maven正在工作,当我直接到中央repo,但是当我配置< mirror> %M2_HOME%\conf\settings .xml 我不能做一个简单的 mvn archetype:create mvn clean

I've just installed Nexus 2.2-01 behind a corporate proxy. Maven is working when I go direct to the Central repo, but when I configure the <mirror> in %M2_HOME%\conf\settings.xml I can't do a simple mvn archetype:create or mvn clean.

从Nexus网络用户界面,我可以:

From the Nexus web UI I can:


  • 中央。

  • 浏览索引

  • ,并从工件信息 / li>
  • ,然后在http://127.0.0.1:8081/nexus/content/groups/public/和\\\
    exus\处查看.jar​​和.jar.sha1文件sonatype-work\\\
    exus\storage\ central

...但由于某种原因,它不会下载 .pom 文件

...but for some reason it does not download the .pom files

Nexus 2.2附带了一个用于Central的代理存储库,我可以浏览索引并下载

Nexus 2.2 came with a proxy repository for Central pre-configured, and I can browse the index and download files manually from the web UI - so why won't it work from Maven?

我已将Nexus与默认HTTP代理设置配置为身份验证,但仍会收到错误,例如:

I have configured Nexus with Default HTTP Proxy Settings with Authentication, but still get errors such as:

[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 
  or one of its dependencies could not be resolved: 
  Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1: 
  Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.4.1 from/to nexus 
  (http://myserver:8081/nexus/content/groups/public): 
  Failed to transfer file: 
  http://myserver:8081/nexus/content/groups/public/
  org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom. 
  Return code is: 504, ReasonPhrase:Gateway Timeout. -> [Help 1]

[INFO] Scanning for projects...
Downloading: http://myserver:8081/nexus/content/groups/public/
  org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom
[WARNING] Failed to retrieve plugin descriptor for 
  org.apache.maven.plugins:maven-clean-plugin:2.4.1: 
  Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 
  or one of its dependencies could not be resolved: 
  Failed to read artifact descriptor for 
  org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1
Downloading: http://myserver:8081/nexus/content/groups/public/
  org/codehaus/mojo/maven-metadata.xml
Downloading: http://myserver:8081/nexus/content/groups/public/
  org/apache/maven/plugins/maven-metadata.xml
[WARNING] Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml
  from/to nexus (http://myserver:8081/nexus/content/groups/public): 
  Failed to transfer file: http://myserver:8081/nexus/content/groups/public/org/
  apache/maven/plugins/maven-metadata.xml. 
  Return code is: 504, ReasonPhrase:Gateway Timeout.


推荐答案

Argh! DNS问题 - 使用maven settings.xml中的IP地址修复了问题。

Argh! DNS issue - using the IP address in the maven settings.xml fixed the problem.

这篇关于Nexus不会从中心下载工件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆