Jenkinsfile copyartifact 在使用带通配符的过滤条件时找不到工件

Jenkinsfile copyartifact cannot find artifact when using filter criteria with wildcard

我有 2 个工作,有 2 个不同的 jenkinsfile。 作业可以通过以下方式正确生成工件:

post {
      always {
          mstest testResultsFile:"testresults*.trx", keepLongStdio: true
          archiveArtifacts artifacts: 'from/path/Deploy/**/*.*', fingerprint: true

我在另一份工作中使用这些工件,使用以下方式进行复制:

        steps {          
          step([$class: 'CopyArtifact', fingerprintArtifacts: true, flatten: true, projectName: 'branch/name', selector: lastSuccessful(), filter: "webpackage.*", target: './artifacts'])

当我 运行 没有 'filter' 条件时,所有工件都会被复制。当我像上面那样使用 'filter' 时,我有这个错误:

ERROR: Failed to copy artifacts from branch/name with filter: webpackage.*

Jenkins 和代理 运行正在 Windows SO 上。 我应该以不同的方式指定路径吗?

根据文档,CopyArtifact 使用 ant 表达式语法。因此这可能适用于路径。我也会跳过这个点。

    steps {          
      step([$class: 'CopyArtifact', fingerprintArtifacts: true, flatten: true, projectName: 'branch/name', selector: lastSuccessful(), filter: "**/webpackage*", target: './artifacts'])