Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nexus can't find artifact that is in Maven Central

I have a Nexus server with group-type repository that contains Maven Center. I can see org.codehaus.mojo:cobertura-maven-plugin:2.5.1 artifacts (both pom and jar) in Maven Center [1], but when I'm trying to download this artifact using Maven, it says:

Downloading: https://example.com/nexus/content/groups/all/org/codehaus/mojo/cobertura-maven-plugin/2.5.1/cobertura-maven-plugin-2.5.1.pom
[WARNING] The POM for org.codehaus.mojo:cobertura-maven-plugin:jar:2.5.1 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.523s
[INFO] Finished at: Wed May 16 16:31:24 EEST 2012
[INFO] Final Memory: 18M/219M
[INFO] ------------------------------------------------------------------------
[INFO] [16:31:24.647] Execute org.codehaus.mojo:cobertura-maven-plugin:2.5.1:cobertura done: 3978 ms
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] example project 1 ................................. FAILURE [10.077s]
[INFO] example project 2 ................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.804s
[INFO] Finished at: Wed May 16 16:31:24 EEST 2012
[INFO] Final Memory: 17M/218M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.codehaus.mojo:cobertura-maven-plugin:2.5.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.codehaus.mojo:cobertura-maven-plugin:jar:2.5.1: Could not find artifact org.codehaus.mojo:cobertura-maven-plugin:pom:2.5.1 in example.com (https://example.com/nexus/content/groups/all) -> [Help 1]
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project example project 1: Can not execute Sonar: Unable to execute maven plugin: Exception during execution of org.codehaus.mojo:cobertura-maven-plugin:2.5.1:cobertura -> [Help 2]

Any ideas why it can't download artifacts?

UPD: Yes, I've set mirror in settings.xml and yes, repository is 'In Service', and only reversed proxy is used.

like image 385
Dmitriy Sukharev Avatar asked Nov 13 '22 05:11

Dmitriy Sukharev


1 Answers

You have to have your settings.xml pointing to the "all" group you have defined. In addition you have to override "central" for repository and pluginRepository (see http://www.sonatype.com/books/nexus-book/reference/maven-sect-single-group.html) and ensure that central is part of your all group.

Once that is all good try your project again forcing updates with -U e.g.

mvn -U clean install
like image 178
Manfred Moser Avatar answered Dec 06 '22 17:12

Manfred Moser