2015-12-22 18 views
0

的代理我settting.xml服務器無法爲中央存儲庫

<mirror> 
    <id>Public Repositories</id> 
    <mirrorOf>central</mirrorOf> 
    <name>Public Repositories</name> 
    <url>http://10.97.19.51:8081/nexus/content/groups/public/</url> 
</mirror> 

然後,當我執行添加以下代碼:MVN全新的編譯,它失敗!

[INFO] Scanning for projects... 
[INFO]                   
[INFO] ------------------------------------------------------------------------ 
[INFO] Building second 0.0.1-SNAPSHOT 
[INFO] ------------------------------------------------------------------------ 
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ second --- 
[INFO] Deleting E:\EclipseWorkspace\second\target 
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ second --- 
[INFO] Using 'UTF-8' encoding to copy filtered resources. 
[INFO] skip non existing resourceDirectory E:\EclipseWorkspace\second\src\main\resources 
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ second --- 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 0.459 s 
[INFO] Finished at: 2015-12-22T17:47:20+08:00 
[INFO] Final Memory: 8M/155M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project second: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile failed: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be resolved: Failure to find com.google.collections:google-collections:jar:1.0 in http://11.97.19.55:8081/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of Public Repositories has elapsed or updates are forced -> [Help 1] 
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException 

以下是我在Nexus中存儲庫的配置。

enter image description here

enter image description here

有人知道原因嗎?謝謝!!

+1

將你的截圖添加到你的問題爲文本! – sschrass

+0

還詳細說明了您嘗試使用您的連接代理的依賴關係或存儲庫,並將信息添加到您的問題中。 (在這種情況下,nexus repo-config可能是一個截圖)。 – sschrass

回答

1

讓您的Nexus代理一切由:

<mirrorOf>*</mirrorOf> 

確保你有你的關係insance配置爲proxy遠程倉庫。 (也許用你的連接的瀏覽功能來檢查它)。 確保您已將遠程存儲庫添加到組public,以便maven可以訪問它。

+0

或者作爲中央存儲庫的代理或者所有遠程存儲庫都沒有問題。 – maomao

+1

然後卸載你的連接?這是聯結(或任何其他工具)儘可能代理的目的,並且減少公共回購的負擔。 – sschrass

+0

我刪除.m2中的存儲庫文件夾,然後重試,它可以工作! – maomao