5

我有一个包含 Maven 中心的组类型存储库的 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 中设置了镜像,是的,存储库是“服务中”,并且只使用了反向代理。

4

2 回答 2

1

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

一旦一切顺利,再次尝试使用 -U 强制更新您的项目,例如

mvn -U clean install
于 2012-11-21T16:42:28.787 回答
0

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

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

于 2012-05-20T02:57:46.750 回答