我们遇到了问题。我在 Jenkins 上设置了工作,在构建项目时它从 Nexus 中获取 Artifact 。但即使它下载了它们,作业也失败了,无法找到 Artifact 。这种情况仅发生在我们手动导入到 nexus 的 Artifact 上。
有什么提示吗?
[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
中检查依赖关系。
因为实际情况下只显示“正在下载”,所以会出现已下载的消息。
首先检查网络设置和互联网。
如果 n/w 不是问题,请删除
~/.m2
文件夹并重试
关于java - 从 Nexus 下载后,Maven 找不到 Artifact ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48019700/