Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Maven Nexus赢得';t从中心下载工件_Maven_Configuration_Proxy_Installation_Nexus - Fatal编程技术网

Maven Nexus赢得';t从中心下载工件

Maven Nexus赢得';t从中心下载工件,maven,configuration,proxy,installation,nexus,Maven,Configuration,Proxy,Installation,Nexus,我刚刚在一个公司代理后面安装了Nexus2.2-01。当我直接转到中央回购时,Maven正在工作,但当我在%M2\u HOME%\conf\settings.xml中配置时,我无法执行简单的mvn原型:创建或mvn clean 从Nexus web UI,我可以: 中环的“浏览远程” “浏览索引” 从“工件信息”选项卡上,我可以下载JAR(不是本地缓存的) 然后查看位于“”的.jar和.jar.sha1文件http://127.0.0.1:8081/nexus/content/groups/p

我刚刚在一个公司代理后面安装了Nexus2.2-01。当我直接转到中央回购时,Maven正在工作,但当我在
%M2\u HOME%\conf\settings.xml中配置
时,我无法执行简单的
mvn原型:创建
mvn clean

从Nexus web UI,我可以:

  • 中环的“浏览远程”
  • “浏览索引”
  • 从“工件信息”选项卡上,我可以下载JAR(不是本地缓存的)
  • 然后查看位于“”的.jar和.jar.sha1文件http://127.0.0.1:8081/nexus/content/groups/public/和“\nexus\sonatype work\nexus\storage\central”
…但由于某些原因,它没有下载
.pom
文件

Nexus2.2附带了一个用于中央预配置的代理存储库,我可以从web UI手动浏览索引和下载文件——那么为什么它不能在Maven上工作呢

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

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


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

另一个答案是正确的,但对于那些遇到相同问题但上面的答案没有帮助的人,请注意:检查您的settings.xml代理设置。

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

因此,似乎

  • settings.xml中的代理部分导致了一个问题(您应该删除或修复它们)
  • maven settings.xml中的URL问题
  • 如果URL在其中定义正确,则可能需要在中打开hosts文件 C:\Windows\System32\drivers\etc 并将要连接的服务器映射到其相应的IP…方法是添加一行,如下所示:

    11.111.11.11报告URL


    这样,您就可以声明名为RepoUrl的baseurl实际上是ip 11.1…

    使用哪个ip地址在哪里?我有同样的问题。nexus YOUR_SERVER_ip:8081/nexus/content/groups/public*nexus YOUR_SERVER_ip:8081/nexus/content/groups/public*
    [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.