2

我使用nexus开源版本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 找到支持信息。

任何提示

4

2 回答 2

4

正如布赖恩所说的那样。您可能只有镜像存储库,而没有像 nexus 文档所说的那样使用那些虚假的中心 URL 来设置配置文件。如果您在调试模式下运行 maven,您会看到诸如“跳过禁用的存储库中心”之类的内容。- disabled 是指适用于特定工件的策略。


因为您想要可能具有相关策略的 SNAPSHOT 工件,<snapshots> <enabled>true</enabled>而 Maven 中央<snapshots> <enabled>false</enabled>如果没有 nexus 文档中的 hack,它就无法工作。


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

希望它有助于澄清这个问题,很高兴了解它

于 2010-06-12T00:34:02.943 回答
2

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

于 2010-06-06T01:51:00.970 回答