2012-12-18 63 views
2

我剛剛將Nexus 2.2-01安裝在公司代理之後。當我直接進入中央倉庫時,Maven正在工作,但是當我配置<mirror>%M2_HOME%\conf\settings.xml時,我無法執行簡單的mvn archetype:createmvn cleanNexus不會從中央下載文物

從Nexus的網絡界面,我可以:

  • 在中央 「瀏覽遠程」。
  • 「瀏覽目錄」
  • 和它說:「(不本地緩存)」中的「神器信息」選項卡,我可以下載的罐子
  • ,然後看到的.jar和.jar.sha1文件「 http://127.0.0.1:8081/nexus/content/groups/public/「和」\ nexus \ sonatype-work \ nexus \ storage \ central「

......但由於某些原因,下載.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. 

回答

2

哎呀! DNS問題 - 使用maven settings.xml中的IP地址解決了問題。

+0

使用哪個IP地址在哪裏?我有同樣的問題。 –

+0

<! - 這將其他一切/公共 - > 關係 的http:// YOUR_SERVER_IP:8081 /關係/內容/組/公共 \t *

+0

<! - 這將其他一切/公共 - > 關係 HTTP:// YOUR_SERVER_IP:8081 /關係/內容/組/公共 \t *

0

另一個答案是正確的,但只是一個筆記給那些誰在這裏得到同樣的問題,但上面的答案沒有幫助:檢查您的settings.xml代理設置。

0

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