上传已存在的工件时“无法找到工件”?

问题描述 投票:0回答:1

我正在尝试使用以下命令上传工件:

jf rt upload "/local/dir/" my-repo/path/to/ --recursive --url my.artifactory.server.com --flat --access-token $JFROG_ACCESS_TOKEN 

如果指定位置不存在该文件,则此方法可以正常工作。但是如果一个文件已经存在——我想覆盖它,但我收到以下错误:

04:42:17 [Warn] [Thread 1] (Attempt 4) - Failure occurred while uploading to https://my.artifactory.server.com/artifactory/my-repo/path/to/file.pdf: server response: 404 Not Found
{
  "errors" : [ {
    "status" : 404,
    "message" : "Could not locate artifact 'my-repo:path/to/file.pdf'."
  } ]
}
04:42:17 [Info] [Thread 1]  executor timeout after 3 attempts with 0 milliseconds wait intervals
04:42:17 [Error] server response: 404 Not Found

我发现这个答案与建议

jfrog rt c
存储凭据的错误相同,但据我所知,这是一个交互式命令,并且我在脚本中运行它,因此交互式不是一个选项。

有办法解决这个问题吗?

artifactory jfrog-cli
1个回答
0
投票

我使用访问令牌配置了 CLI,它工作正常。

jf rt upload /path/mydirectory/ example-repo-local/new/ --flat
07:56:16 [🔵Info] These files were uploaded:

📦 example-repo-local
└── 📁 new
    ├── 📄 gradle-wrapper.jar
    └── 📄 maven-wrapper.jar
{
  "status": "success",
  "totals": {
    "success": 2,
    "failure": 0
  }
}

我的CLI版本是2.54.0 我的Artifactory版本是7.81.2 也许您正在较低版本的 CLI/Artifactory 中进行测试。

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.