如何从上载到nexus上的maven2存储库的工件中删除时间戳? [英] How to remove timestamp from artifacts uploaded to maven2 repository on nexus?

查看:403
本文介绍了如何从上载到nexus上的maven2存储库的工件中删除时间戳?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过Nexus存储库上的Jenkins管道上传一些工件,该存储库由maven2托管.我在Jenkins中使用以下代码块上传工件:

I am uploading a few artifacts through a Jenkins pipeline on a Nexus repository, the repository is maven2 hosted. I use the following block in Jenkins to upload artifacts:

nexusArtifactUploader (
            artifacts: [
                    [artifactId: 'artifact-part1',
                    classifier: '',
                    file: "build/libs/artifact-part1.jar",
                    type: 'jar'],
                    [artifactId: 'artifact-part2',
                    classifier: '',
                    file: "build/libs/artifact-part2.jar",
                    type: 'jar']
                ],
                credentialsId: 'nexus_cred',
                groupId: "$group", nexusUrl: "$nexusUrl:8082",
                nexusVersion: 'nexus3',
                protocol: 'http',
                repository: 'project_dev',
                version: "$version-SNAPSHOT"
        )

它已上载到nexus,但文件名带有时间戳后缀.我没有在任何地方提及时间戳,我不确定如何添加时间戳.看起来是这样的:

It gets uploaded to nexus but the file name has a suffix of timestamp. I am not mentioning the timestamp anywhere, I am not sure how it gets added. This is how it looks:

我不需要添加时间戳.添加时间戳会创建多个版本,我想知道是否有删除时间戳的方法,以便仅保存一个版本.我该怎么办?

I don't wan't the timestamp to be added. Adding the timestamp creates multiple versions, I would like to know if there is any way of removing the timestamp so that only one version is saved. What can I do?

推荐答案

快照工件会自动与时间戳一起存储在资源库中.您仍然可以通过0.1-SNAPSHOT引用它们,Nexus会自动解决该问题.

Snapshot artifacts are automatically stored with a timestamp inside the repository. You can still reference them by 0.1-SNAPSHOT and Nexus will automatically resolve that.

所以不用担心.

这篇关于如何从上载到nexus上的maven2存储库的工件中删除时间戳?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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