You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

JFrog Cloud间推送复制后Maven构建无法找到构件求助

问题描述

我最近配置了从现有JFrog Cloud账户到新JFrog Cloud账户的推送式复制,但之后本地的release和快照仓库在构建项目时开始抛出依赖解析失败的错误,已确认JAR及对应POM文件已复制到新账户中。

错误日志

$ mvn clean install -P artifactory -U
[INFO] Scanning for projects...
[INFO] 
[INFO] -----------------------< com.mydomain.myproj:mainproject >------------------------
[INFO] Building mainproject 1.0.0
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from central: https://myartifactory.jfrog.io/artifactory/myproj-mvn-release-virtual/com/example/myproject/apiclient/0.43/apiclient-0.43.pom
[WARNING] The POM for com.mydomain.myproject:apiclient:jar:0.43 is missing, no dependency information available
Downloading from central: https://myartifactory.jfrog.io/artifactory/myproj-mvn-release-virtual/com/example/myproject/thirdparty-client/0.7/thirdparty-client-0.7.pom
[WARNING] The POM for com.mydomain.myproject:thirdparty-client:jar:0.7 is missing, no dependency information available
Downloading from central: https://myartifactory.jfrog.io/artifactory/myproj-mvn-release-virtual/com/example/myproject/interference-sdk/0.16/interference-sdk-0.16.pom
[WARNING] The POM for com.mydomain.myproject:interference-sdk:jar:0.16 is missing, no dependency information available
Downloading from central: https://myartifactory.jfrog.io/artifactory/myproj-mvn-release-virtual/com/example/myproject/roger-client/0.3/roger-client-0.3.pom
[WARNING] The POM for com.mydomain.myproject:roger-client:jar:0.3 is missing, no dependency information available
Downloading from snapshots: https://myartifactory.jfrog.io/artifactory/myproj-mvn-snapshot-virtual/com/example/myteam/sprin-param/2.0.5-SNAPSHOT/maven-metadata.xml
Downloading from snapshots: https://myartifactory.jfrog.io/artifactory/myproj-mvn-snapshot-virtual/com/example/myteam/sprin-param/2.0.5-SNAPSHOT/sprin-param-2.0.5-SNAPSHOT.pom
[WARNING] The POM for com.mydomain.myteam:sprin-param:jar:2.0.5-SNAPSHOT is missing, no dependency information available
Downloading from central: https://myartifactory.jfrog.io/artifactory/myproj-mvn-release-virtual/com/example/myproject/apiclient/0.43/apiclient-0.43.jar
Downloading from central: https://myartifactory.jfrog.io/artifactory/myproj-mvn-release-virtual/com/example/myproject/thirdparty-client/0.7/thirdparty-client-0.7.jar
Downloading from central: https://myartifactory.jfrog.io/artifactory/myproj-mvn-release-virtual/com/example/myproject/interference-sdk/0.16/interference-sdk-0.16.jar
Downloading from central: https://myartifactory.jfrog.io/artifactory/myproj-mvn-release-virtual/com/example/myproject/roger-client/0.3/roger-client-0.3.jar
Downloading from snapshots: https://myartifactory.jfrog.io/artifactory/myproj-mvn-snapshot-virtual/com/example/myteam/sprin-param/2.0.5-SNAPSHOT/sprin-param-2.0.5-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  9.618 s
[INFO] Finished at: 2022-08-13T19:57:44+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project mainproject: Could not resolve dependencies for project com.mydomain.myproj:mainproject:jar:1.0.0: The following artifacts could not be resolved: com.mydomain.myproject:apiclient:jar:0.43, com.mydomain.myproject:thirdparty-client:jar:0.7, com.mydomain.myproject:interference-sdk:jar:0.16, com.mydomain.myproject:roger-client:jar:0.3, com.mydomain.myteam:sprin-param:jar:2.0.5-SNAPSHOT: Could not find artifact com.mydomain.myproject:apiclient:jar:0.43 in central (https://myartifactory.jfrog.io/artifactory/myproj-mvn-release-virtual) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

排查解决思路

  • 检查虚拟仓库关联:确认新账户中myproj-mvn-release-virtual和myproj-mvn-snapshot-virtual虚拟仓库,是否正确关联了存放复制资源的本地仓库。虚拟仓库未关联对应本地仓库时,Maven请求会找不到资源。
  • 验证文件存储路径:在新JFrog账户中核对复制后的POM/JAR文件路径,是否与Maven请求的路径完全一致(如com/example/myproject/apiclient/0.43/apiclient-0.43.pom)。推送复制可能因路径映射规则错误,导致资源存放到了不正确的路径下。
  • 检查仓库访问权限:确认构建使用的JFrog用户账号,对新账户中的release、快照本地仓库拥有读取权限。权限不足会导致Maven返回资源不存在的错误。
  • 核对Maven配置:检查artifactory profile中的仓库URL是否指向新账户的正确地址,而非旧账户地址;同时确认镜像配置未错误覆盖仓库请求路径。
  • 重建仓库索引:JFrog Maven仓库需要生成索引才能被Maven正确识别,在新账户的仓库管理中手动触发release和快照仓库的索引重建,等待索引完成后再尝试构建。
  • 直接测试资源访问:用浏览器或curl命令直接访问错误日志中的POM/JAR URL,确认是否能正常下载。如果无法下载,说明仓库资源本身存在访问问题;如果可以下载,则排查Maven本地缓存或配置问题。
  • 清理Maven本地缓存:手动删除本地仓库中对应依赖的目录(如~/.m2/repository/com/mydomain/myproject/apiclient/0.43),再重新执行构建。

内容的提问来源于stack exchange,提问作者Saif

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.22 10:18:18