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

时间:2017-12-29 08:30:36

标签: java maven jenkins build nexus

我们遇到了问题。我在jenkins上建立了工作,在建立一个项目时,它从nexus中获取了工件。但即使它下载了它们,也无法找到工件失败的工件。它只发生在我们手动导入到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]`

2 个答案:

答案 0 :(得分:0)

我认为它尚未完全下载,您可以在~/.m2/repository中查看相关性。 因为它在实际情况下仅显示“下载”,所以它将显示下载消息。

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

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

答案 1 :(得分:0)

你看到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)。