为maven工件设置分类器使用Jenkins管道在Jfrog Artifactory中促进构建



我正在尝试将snapshot jar升级到发行版。我需要使用maven分类器名称来区分升级的jar。在jfog Artifactory中推广构建时,有没有办法更改版本或设置分类器?

def promotionConfig = [
// Mandatory parameters
'targetRepo'         : 'libs-prod-ready-local',
// Optional parameters
// The build name and build number to promote. If not specified, the Jenkins job's build name and build number are used
'buildName'          : buildInfo.name,
'buildNumber'        : buildInfo.number,
// Comment and Status to be displayed in the Build History tab in Artifactory
'comment'            : 'this is the promotion comment',
'status'             : 'Released',
// Specifies the source repository for build artifacts.
'sourceRepo'         : 'libs-staging-local',
// Indicates whether to promote the build dependencies, in addition to the artifacts. False by default
'includeDependencies': true,
// Indicates whether to copy the files. Move is the default
'copy'               : true,
// Indicates whether to fail the promotion process in case of failing to move or copy one of the files. False by default.
'failFast'           : true
]
// Promote build
server.promote promotionConfig

管道升级DSL(或工件构建升级API(不支持作为升级的一部分更改工件的版本或分类器
您所能做的就是利用发布管理功能来进行发布构建,从而更改工件版本
使用Maven时,发布管理功能允许您更改工件版本,例如从快照更改为发布版本,并将此更改应用于.pom文件
Jenkins Artifactory插件的Maven Release Management with Artifactory部分包含执行此转换所需的语法和解释。

最新更新