【问题标题】:Maven Could not find artifact after downloading from NexusMaven 从 Nexus 下载后找不到工件
【发布时间】:2018-06-09 17:21:18
【问题描述】:

我们遇到了问题。我在 jenkins 上设置了工作,并在构建项目时从 nexus 获取工件。但即使它下载了它们,作业也因找不到工件而失败。它只发生在我们手动导入到关系中的工件上。

有什么提示吗?

 [INFO] Downloading: http://xxx/nexus/content/groups/public/com/oracle/aqapi          /12.1.0.2/aqapi-12.1.0.2.pom
 [WARNING] The POM for com.oracle:aqapi:jar:12.1.0.2 is missing, no dependency information available
 [INFO] Downloading: http://xxx/nexus/content/groups/public/com/ibm/com.ibm.mq/7.1/com.ibm.mq-7.1.pom
 [WARNING] The POM for com.ibm:com.ibm.mq:jar:7.1 is missing, no dependency information available
 [INFO] Downloading: http://xxx/nexus/content/groups/public/com/ibm/com.ibm.dhbcore/7.1/com.ibm.dhbcore-7.1.pom
 [WARNING] The POM for com.ibm:com.ibm.dhbcore:jar:7.1 is missing, no dependency information available
 [INFO] Downloading: http://xxx/nexus/content/groups/public/com/oracle/aqapi/12.1.0.2/aqapi-12.1.0.2.jar
 [INFO] Downloading: http://xxx/nexus/content/groups/public/com/ibm/com.ibm.mq/7.1/com.ibm.mq-7.1.jar
 [INFO] Downloading: http://xxx/nexus/content/groups/public/com/ibm/com.ibm.dhbcore/7.1/com.ibm.dhbcore-7.1.jar
 Started calculate disk usage of build
 Finished Calculation of disk usage of build in 0 seconds
 Started calculate disk usage of workspace
 Finished Calculation of disk usage of workspace in 0 seconds
 ....
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.091s
[INFO] Finished at: Fri Dec 22 14:09:58 CET 2017
[INFO] Final Memory: 16M/491M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project XXX: Could not resolve dependencies for project YYY:jar:2.14.11: The following artifacts could not be resolved: com.oracle:aqapi:jar:12.1.0.2, com.ibm:com.ibm.mq:jar:7.1, com.ibm:com.ibm.dhbcore:jar:7.1: Could not find artifact com.oracle:aqapi:jar:12.1.0.2 in nexus (http://xxx/nexus/content/groups/public) -> [Help 1]
[ERROR]`

【问题讨论】:

  • 给定的工件不在您的存储库管理器中...是否已将这些工件上传到 3rdparty 存储库?如果是,您的公众是否包含此3rdparty 存储库..?

标签: java maven jenkins build nexus


【解决方案1】:

我认为它还没有完全下载,你可以检查~/.m2/repository的依赖关系。 因为它在实际情况下只显示“正在下载”,所以它会显示下载消息。

  1. 首先检查网络设置和互联网。

  2. 如果 n/w 不是问题,请删除 ~/.m2 文件夹并重试一次

【讨论】:

  • 谢谢,好像没有下载。将是 n/w 问题:
【解决方案2】:

您看到 Nexus 中的依赖关系了吗? nexus中pom文件中的信息是否与你的pom对应?

http://nexusUrl/nexus/content/repositories/central/checkstyle/checkstyle/4.1/checkstyle-4.1.pom

<?xml version="1.0"?>
<project>
                <modelVersion>4.0.0</modelVersion>
                <groupId>checkstyle</groupId>
                <artifactId>checkstyle</artifactId>
                <version>4.1</version>
                <dependencies>
                               ...
                </dependencies>
</project>

在你的 pom 中:

<dependency>
                <groupId>checkstyle</groupId>
                <artifactId>checkstyle</artifactId>
                <version>4.1</version>
</dependency>

并检查您的 Nexus 访问设置 (settings.xml)。

【讨论】:

    猜你喜欢
    • 2015-12-23
    • 1970-01-01
    • 1970-01-01
    • 2018-09-12
    • 2014-04-13
    • 1970-01-01
    • 2016-05-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多