簡體   English   中英

Nexus 不會從 Central 下載工件

[英]Nexus won't download artifacts from Central

我剛剛在公司代理后面安裝了 Nexus 2.2-01。 當我直接進入 Central repo 時,Maven 正在工作,但是當我在%M2_HOME%\\conf\\settings.xml配置<mirror> ,我無法執行簡單的mvn archetype:createmvn clean

從 Nexus 網絡用戶界面,我可以:

  • 中環的“遠程瀏覽”。
  • “瀏覽索引”
  • 並從“工件信息”選項卡中顯示“(非本地緩存)”我可以下載罐子
  • 然后在“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 地址修復了該問題。

另一個答案是正確的,但只是給遇到相同問題但上述答案無濟於事的人的注釋:檢查您的 settings.xml 代理設置。

我今天看到了這個錯誤,唯一修復它的是回到 maven 3.2.5(從 3.3.9)

為此,似乎要么

  1. settings.xml 中的代理部分導致了問題(您應該刪除它們或修復它們)
  2. Maven settings.xml 中的 URL 問題

如果在那里正確定義了 url,則可能您需要打開 C:\\Windows\\System32\\drivers\\etc 中的主機文件並將您要連接的服務器映射到其相應的 IP... 通過添加如下所示的行:

11.111.11.11 回購

通過這種方式,您聲明名為 RepoUrl 的 baseurl 實際上是 ip 11.1 ....

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM