【问题标题】:Set classifier for maven artifacts Promoting Builds in Jfrog Artifactory using Jenkins pipeline为 Maven 工件设置分类器使用 Jenkins 管道促进 Jfrog Artifactory 中的构建
【发布时间】:2020-03-15 17:06:13
【问题描述】:

我正在尝试将快照 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

【问题讨论】:

    标签: jenkins-pipeline artifactory


    【解决方案1】:

    管道promotion DSL(或 Artifactory 构建提升 API)不支持在提升过程中更改工件的版本或分类器。
    您可以利用release management 功能来获得更改工件版本的发布版本。
    使用 Maven 时,发布管理功能允许您更改工件版本,例如从快照到发布版本,并将此更改也应用于 .pom 文件。
    Jenkins Artifactory 插件的Maven Release Management with Artifactory 部分包含执行此转换所需的语法和说明。

    【讨论】:

      猜你喜欢
      • 2021-12-17
      • 1970-01-01
      • 2022-06-11
      • 1970-01-01
      • 2021-03-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-20
      • 1970-01-01
      相关资源
      最近更新 更多