Artifactory 快照文件名处理 [英] Artifactory Snapshot filename handling

查看:33
本文介绍了Artifactory 快照文件名处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们的工件中,我们定义了一个快照存储库来处理最多 5 个独特的快照.我们在文件名中添加了 -SNAPSHOT-.extension.SNAPSHOT 也被转换为时间戳.构建是用 gradle 完成的,神器是用竹子和神器插件发布的.

In our artifactory we have a snapshot repo defined to handle max 5 unique snapshots. We added -SNAPSHOT-.extension to the filename. SNAPSHOT gets also converted to timestamp. Build is done with gradle and artifact gets published with bamboo and artifactory plugin.

部署到 artifactory 的文件...

A file deployed to artifactory ...

inhouse-snapshots:com/example/project/subproject/trunk-SNAPSHOT/subproject-trunk-SNAPSHOT-79.amp

变成……

inhouse-snapshots:com/example/project/subproject/trunk-SNAPSHOT/subproject-trunk-20120321.154621-1-79.amp

这很好,每个版本都会添加一个带有递增版本号的新文件,但时间戳编号始终保持为 20120321.154621-1,因此我们有如下文件列表:

This is fine and every build adds a new file with incremented build number, but the timestamp-number always stays 20120321.154621-1 so we have a file list like:

  • subproject-trunk-20120321.154621-1-79.amp
  • subproject-trunk-20120321.154621-1-80.amp
  • subproject-trunk-20120321.154621-1-81.amp

有人对另一种目录布局有解决方案或建议吗?

Anybody has a solution or suggestion for a another directory layout?

推荐答案

如您所见,您附加到部署文件名的内部版本号被标识为分类器;这是因为 Maven 没有指定具有非唯一快照的内部版本号.

As you've correctly observed, the build number you've attach to the deployed file name is identified as a classifier; this is because Maven doesn't specify a build number with a non-unique snapshot.

Artifactory 为工件的批次"维护时间戳和构建号的相同组合,并在检测到新的批次"时撞击"时间戳和构建号;为了将非唯一快照转换为唯一快照,Artifactory 有两种检测工件批次"的方法:

Artifactory maintains the same combination of timestamp and build number for "batches" of artifacts and "bumps" the timestamp and build number when it detects a new "batch"; there are 2 ways in which Artifactory detects artifact "batches" for the purpose of converting non-unique to unique snapshots:

  1. 工件按以下确切顺序部署:工件(无分类器)、POM、附加工件(带分类器);在一个 POM 之后要部署的第一个普通工件将创建一个新的批次";因此提供了一个新的时间戳和构建器编号.

  1. Artifacts are deployed in the exact order of: artifact (no classifier), POM, attached artifacts (with classifiers); The first ordinary artifact to be deployed after the a POM will create a new "batch"; hence providing a new timestamp and builder number.

使用矩阵部署的工件键build.timestamp"的参数和基于毫秒的纪元时间戳的值;具有相同时间戳值的工件将关联到同一个批次"下.

Artifacts deployed with a matrix param of the key "build.timestamp" and a value of a millisecond-based epoch timestamp; Artifacts with same timestamp values will be associated under the same "batch".

您应该从已部署的文件中省略内部版本号,并使用build.timestamp"矩阵参数进行部署(以使 Artifactory 在每个新部署中增加批次")或部署已具有唯一快照的文件.

You should either omit the build number from the deployed file and deploy it with a "build.timestamp" matrix param (to make Artifactory bump the "batch" on each new deployment) or deploy the files already with the unique snapshot.

这篇关于Artifactory 快照文件名处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆