繁体   English   中英

从Nexus下载后,Maven无法找到工件

[英]Maven Could not find artifact after downloading from Nexus

我们有一个问题。 我在詹金斯(Jenkins)上建立了工作,并在构建项目时从关系中获取工件。 但是,即使下载了它们,也找不到因工件而失败的工作。 它仅发生在我们手动导入到链接的工件上。

有什么提示吗?

 [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]`

我认为它尚未完全下载,您可以在~/.m2/repository检查是否存在依赖性。 因为在实际情况下它仅显示“正在下载”,所以它将显示已下载的消息。

  1. 首先检查n / w设置和互联网。

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

您在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)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM