maomao
maomao

Reputation: 81

Private server created by Nexus failed to be the proxy of central repository

I add this code in 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>

Then when I execute: mvn clean compile, it failed!

[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

the following is my configuration of my repository in Nexus.

enter image description here

enter image description here

Anybody know the reason? Thank you!!

Upvotes: 0

Views: 61

Answers (1)

sschrass
sschrass

Reputation: 7166

Make your nexus a proxy for everything by:

<mirrorOf>*</mirrorOf>

Make sure you have the remote repository configured as proxy in your nexus insance. (Maybe check it with the browsing feature of your nexus). Make sure you've added the remote repository to the group public so it is accessible for maven.

Upvotes: 1

Related Questions