maven-2 - 无法从 Nexus 获得正确的软件包?错误 "mvn help:effective-settings"

标签 maven-2 nexus

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

任何提示

最佳答案

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


因为你想要SNAPSHOT工件,它可能有相关的政策<snapshots> <enabled>true</enabled>和maven中央有<snapshots> <enabled>false</enabled>如果没有 Nexus 文档中的 hack,它就无法工作。


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

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

关于maven-2 - 无法从 Nexus 获得正确的软件包?错误 "mvn help:effective-settings",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2870327/

相关文章:

git - 无法使用 Hudson + Git + Maven Release Plugin 获得自动发布

java - 在 Eclipse 中自动导入新的 Maven 模块

maven-2 - Maven:如何从远程存储库下载/包含文件?

maven - 如何从 Nexus Professional 迁移到 Nexus OSS

maven-2 - maven-assembly-plugin 导致测试运行两次

eclipse - 为什么我在eclipse中搜索不到maven项目

maven - 为什么 Maven 会错误地将快照上传到发布存储库?

java - Docker 自动构建从 Maven Sonatype Nexus 存储库下载私有(private) jar

maven - 在 Maven 中为多个存储库设置单个服务器凭据

maven - 上传 Quarkus 依赖到 Nexus