Jenkins:nexusArtifactUploader 在上传到 nexus 时会自动重命名我的 zip 文件

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

我有一个詹金斯管道,它将上传我的工件(一个zip文件)到nexus。
为此,我使用 nexusArtifactUploader
这样做时,nexusArtifactUploader 通过在末尾附加日期时间和一些数字来重命名我的 zip 文件,而我想按原样保留文件的实际名称。
片段:

nexusArtifactUploader artifacts: [[artifactId: 'my_project_load', classifier: '', file: '/apps/external/5/jenkins-node-home/workspace/my_project_load_load-0.1.29-SNAPSHOT.zip', type: 'zip']], credentialsId: 'Aiman_Sarosh_cred', groupId: 'com.group.id', nexusUrl: 'nexus.com/nexus', nexusVersion: 'nexus2', protocol: 'https', repository: 'ict-snapshots', version: '0.1.29-SNAPSHOT'

我得到了这个:

16:59:14  Uploading: https://nexus.com/nexus/content/repositories/content/repositories/ict-snapshots/com/group/id/my_project_load-0.1.29-SNAPSHOT/0.1.29-SNAPSHOT/my_project_load-0.1.29-SNAPSHOT-0.1.29-20230922.112914-1.zip

我该如何处理?

jenkins jenkins-plugins nexus
1个回答
0
投票

这就是它的工作原理

这个

my_project_load-0.1.29-SNAPSHOT-0.1.29-20230922.112914-1

是:
<ARTIFACT>-<VERSION>[-SNAPSHOT<-TIMESTAMP-INCREMENT>]

Nexus 存储每个

SNAPSHOT
上传的时间戳和增量计数器。但当你指定
-SNAPSHOT
时,maven将始终为你提供最新的服务。 (这也是为什么有针对快照的清理政策

如果您想保留上传的编号,则需要提供发布版本号(即:

0.1.29
)并且不能使用-SNAPSHOT。

© www.soinside.com 2019 - 2024. All rights reserved.