无法从 Nexus 获得正确的软件包? “mvn help:有效设置”中的错误

发布于 2024-09-02 08:06:35 字数 1858 浏览 9 评论 0原文

我使用 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 找到支持信息。

任何提示

I use nexus opensource version maven 2.2.1

When I type "mvn help:effective-settings", i got the error below

[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

When I check the local repository under ~.m2\repository\org\apache\maven\plugins\maven-help-plugin

It has a file 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>

And I can't find any jar files under directory, what's wrong with nexus server ? I can't easily find support information from nexus.

Any hints

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

别靠近我心 2024-09-09 08:06:35

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


因为您想要 SNAPSHOT 工件,它可能具有相关策略 true 并且 Maven Central 有 false 如果没有 nexus 文档中的 hack,它就无法工作。


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

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

It's definitely as Brian said. You probably have only mirrored repositories without doing the hack with setting up the profile as nexus documentation says with those bogus central URLs. If you run maven in debug mode, you would see things like "Skipping disabled repository central". - disabled refers to the policy that applies for a specific artifact.


Because you want SNAPSHOT artifact which probably has the relevant policy <snapshots> <enabled>true</enabled> and maven central has <snapshots> <enabled>false</enabled> it doesn't work without the hack in the nexus documentation.


Mirror only replaces the URL, it doesn't change the policies of the original repositories, but for a repo manager to work, one usually wants to redirect both release and snapshot artifact requests

Hope it helps to clarify this issue, it's good to know about it

絕版丫頭 2024-09-09 08:06:35

看起来您的 settings.xml 可能配置错误。尝试设置像 this,如果您仍然遇到问题,请在 nexus-user 列表中询问我们,我们会将从那里出发。

It looks like you might have your settings.xml misconfigured. Try setting like like this, and if you still have trouble, ask us on the nexus-user list and we'll go from there.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文