Nexus找不到Maven Central中的工件

时间:2012-05-16 13:49:41

标签: maven sonarqube nexus

我有一个包含Maven Center的组类型存储库的Nexus服务器。我可以在Maven Center [1]看到org.codehaus.mojo:cobertura-maven-plugin:2.5.1工件(包括pom和jar),但是当我尝试使用Maven下载这个工件时,它说:

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]

为什么它无法下载工件的任何想法?

UPD:是的,我在settings.xml中设置了镜像,是的,存储库是“在服务中”,只使用了反向代理。

2 个答案:

答案 0 :(得分:1)

您必须让您的settings.xml指向您已定义的“all”组。此外,您必须覆盖存储库和pluginRepository的“中心”(请参阅​​http://www.sonatype.com/books/nexus-book/reference/maven-sect-single-group.html)并确保中心是您所有组的一部分。

一旦这一切都很好,请再次使用-U例如

强制更新项目
mvn -U clean install

答案 1 :(得分:0)

插件通常存储在与“普通”工件不同的存储库中(尽管据我所知,没有真正的理由需要这样做,只是经常这样做。)

仔细检查您的配置并确保您指向的群组中心的插件可用。如果您显示Nexus配置,可能能够查明问题。