首页 > 解决方案 > Jenkins多分支无法找到项目工件副本

问题描述

我正在使用multibranch-pipeline,我需要在信号下游分支中连接 3 个上游分支。当我尝试从上游项目复制工件时,出现以下错误:

ERROR: Unable to find project for artifact copy: http://servername/job/pocbranches/test 这可能是由于项目名称或权限设置不正确;请参阅作业配置中项目名称的帮助。完成:失败

下面的代码是我的下游分支。

copyArtifacts fingerprintArtifacts: true,
projectName:'$projectName',
selector: upstream()

你能帮我解决这个问题吗?

标签: jenkinscompiler-errorsmultibranch-pipeline

解决方案


也许尝试使用绝对文件路径

copyArtifacts fingerprintArtifacts: true,
projectName: '/' + '$projectName',
selector: upstream()

也给予 copyArtifact 许可,如

    options {
        copyArtifactPermission('/' + $projectName)
    }

推荐阅读