首页 文章

Nexus不会从Central下载工件

提问于
浏览
2

我刚刚在公司代理服务器后面安装了Nexus 2.2-01 . 当我直接进入Central repo时,Maven正在工作,但当我在 %M2_HOME%\conf\settings.xml 中配置 <mirror> 时,我无法做一个简单的 mvn archetype:createmvn clean .

从Nexus Web UI我可以:

  • "Browse Remote"在中环 .

  • "Browse Index"

  • 并从"Artifact Information"标签中显示"(Not Locally Cached)"我可以下载 jar

  • 然后在"http://127.0.0.1:8081/nexus/content/groups/public/"和"\nexus\sonatype-work\nexus\storage\central"查看.jar和.jar.sha1文件

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

Nexus 2.2带有一个用于Central预配置的代理存储库,我可以从Web UI手动浏览索引和下载文件 - 那么为什么它不能在Maven中运行?

我已使用身份验证将默认HTTP代理设置配置为Nexus,但仍会出现以下错误:

[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.

3 回答

  • 2

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

  • 0

    另一个答案是正确的,但只是为那些遇到相同问题的人提供的注释,但上述答案没有帮助:检查您的settings.xml代理设置 .

  • 0

    我今天看到这个错误,唯一修复它的是回到maven 3.2.5(从3.3.9开始)

相关问题