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

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

问题描述

在我们的工件中,我们定义了一个快照存储库以处理最多5个唯一快照.我们在文件名中添加了-SNAPSHOT-.extension. SNAPSHOT也将转换为时间戳.用gradle完成构建,并使用Bamboo和artifactory插件发布工件.

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.

已部署到工件的文件...

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 Snapshot文件名处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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