java - 从 Nexus 下载后,Maven 找不到 Artifact

标签 java maven jenkins build nexus

我们遇到了问题。我在 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中检查依赖关系。 因为实际情况下只显示“正在下载”,所以会出现已下载的消息。

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

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

关于java - 从 Nexus 下载后,Maven 找不到 Artifact ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48019700/

相关文章:

spring-boot - 如何在 Spring Boot 2.6.4 中导入 spring-boot-starter-data-solr

jenkins - 如何在 jenkins 管道 groovy 脚本中使用 json 发出 curl 请求

docker - Jenkins 控制台打印编码字符

Github webhook URL 配置问题?如何修复它?

java.lang.NoClassDefFoundError : org/hamcrest/SelfDescribing using Maven 错误

java - 粗体样式在 pdf 输出中不起作用

Java 拒绝检测任何类库

java - 使用 JAX-WS 尝试所有可用的 WSDL IP

android - 如何将自定义maven存储库添加到gradle

java - 测试cucumber时出现错误NoSuchMethodError