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

JFrog Artifactory 4.12.2:上传工件时能否同步设置属性?

Uploading Artifacts with Properties in Artifactory 4.12.2

Hey there! Great question—let's break down how this works in Artifactory 4.12.2, since it's an older version with specific limitations compared to newer releases.

Short Answer

In Artifactory 4.12.2, you cannot set properties at the same time as uploading an artifact—you have to split this into two separate API calls: first upload the file, then apply its properties.

Why This Is the Case

The artifact upload endpoint (typically a PUT request to your target repository path) in 4.12.2 doesn't support attaching properties directly via request parameters, headers, or request body. Property management is handled exclusively by the dedicated Set Properties API endpoint in this version.

Step-by-Step Example

Here's how to do this properly with curl (adjust URLs, credentials, and paths to match your setup):

  1. First, upload your file.txt artifact:

    curl -u your-username:your-password -X PUT "http://your-artifactory-instance/artifactory/your-repo/path/to/file.txt" -T "./file.txt"
    
  2. Then, set the properties for the uploaded file:

    curl -u your-username:your-password -X PUT "http://your-artifactory-instance/artifactory/api/storage/your-repo/path/to/file.txt" \
      -H "Content-Type: application/json" \
      -d '{
        "properties": {
          "project": ["my-project"],
          "environment": ["staging"],
          "version": ["1.0.0"]
        }
      }'
    

Quick Note for Future Reference

If you ever upgrade to a newer Artifactory version (5.x or later), you can simplify this to a single call using the properties query parameter. For example:

curl -u your-username:your-password -X PUT "http://your-artifactory-instance/artifactory/your-repo/path/to/file.txt?properties=project=my-project;environment=staging" -T "./file.txt"

But this won't work in 4.12.2, so stick to the two-step process for your current version.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.20 08:15:57