maven - Nexus 不会从 Central 下载 Artifact

标签 maven configuration proxy installation nexus

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

通过 Nexus Web UI,我可以:

  • 中环的“远程浏览”。
  • “浏览索引”
  • 并且从“Artifact Information”选项卡中显示“(未本地缓存)”我可以下载 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.

最佳答案

啊啊! DNS 问题 - 使用 Maven settings.xml 中的 IP 地址解决了该问题。

关于maven - Nexus 不会从 Central 下载 Artifact ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13927806/

相关文章:

php - 从代理服务器后面安装 Composer

node.js - Maven 前端构建在生成源阶段运行两次

java - 使用 log4j 1.2.17 时的 Stackoverflow

typescript - 如何在angular2中预加载配置文件

configuration - 使用 ui/dashboard 进行企业配置管理的开源解决方案

asp.net - 使用 aspnet_regiis 加密配置节

authentication - pip 安装失败,需要 407 代理身份验证

mysql - 使用 spring、hibernate 和 mysql 设置 pom.xml

java - Spring MongoDb ContextLoaderListener

proxy - 如何使环境变量可用于来自 docker-compose 的 Docker RUN 命令?