无法从Nexus获得正确的包裹? “mvn help:effective-settings”中的错误

时间:2010-05-20 00:25:46

标签: maven-2 nexus

我使用nexus opensource版本maven 2.2.1

当我输入“mvn help:effective-settings”时,我收到了以下错误

[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'help'.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).

Project ID: org.apache.maven.plugins:maven-help-plugin

Reason: Error getting POM for 'org.apache.maven.plugins:maven-help-plugin' from the   repository: Failed to resolve artifact, possibly due to a repository list that is not appropriately equipped for this artifact's metadata.
 org.apache.maven.plugins:maven-help-plugin:pom:2.2-SNAPSHOT

from the specified remote repositories:
 Nexus (http://192.168.56.191:8081/nexus/content/groups/public)

for project org.apache.maven.plugins:maven-help-plugin

当我检查〜.m2 \ repository \ org \ apache \ maven \ plugins \ maven-help-plugin

下的本地存储库时

它有一个文件maven-metadata-central.xml

<?xml version="1.0" encoding="UTF-8"?>
<metadata>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-help-plugin</artifactId>
  <versioning>
    <latest>2.2-SNAPSHOT</latest>
    <release>2.1.1</release>
    <versions>
      <version>2.0</version>
      <version>2.0.1</version>
      <version>2.0.2</version>
      <version>2.1</version>
      <version>2.1.1</version>
      <version>2.2-SNAPSHOT</version>
    </versions>
   <lastUpdated>20100519065440</lastUpdated>
  </versioning>
</metadata>

我在目录下找不到任何jar文件,nexus服务器出了什么问题?我无法轻易找到nexus的支持信息。

任何提示

2 个答案:

答案 0 :(得分:4)

这绝对是布莱恩说的。您可能只有镜像存储库而没有设置配置文件,因为nexus文档说这些虚假的中央URL。如果您在调试模式下运行maven,您会看到诸如“跳过已禁用的存储库中心”之类的内容。 - disabled表示适用于特定工件的策略。


因为您希望SNAPSHOT工件可能具有相关策略<snapshots> <enabled>true</enabled>且maven central具有<snapshots> <enabled>false</enabled>,所以如果没有nexus文档中的hack,它就无法工作。


镜像只替换URL,它不会更改原始存储库的策略,但是要使repo管理器工作,通常需要重定向发布和快照工件请求

希望有助于澄清这个问题,了解它是很好的

答案 1 :(得分:2)

看起来您的settings.xml可能配置错误。尝试设置如this,如果您仍有问题,请在nexus-user列表上询问我们,我们将从那里开始。