【问题标题】:Error: More than one package matched with specified pattern: D:\a\r1\a\**\*.zip. Please restrain the search pattern错误:多个包与指定模式匹配:D:\a\r1\a\**\*.zip。请限制搜索模式
【发布时间】:2019-08-25 00:37:01
【问题描述】:

我创建了一个可以正常工作并在最后发布工件的构建管道。

我还创建了一个发布管道来将 REST API 部署到 Azure Web 应用

发布管道任务有这样的信息:

$(System.DefaultWorkingDirectory)/**/*.zip

但是我得到了这个错误:

Error: More than one package matched with specified pattern: D:\a\r1\a\**\*.zip. Please restrain the search pattern.

当我看到放置文件夹时,我确实可以看到按日期排列的文件夹,并且有几个 .zip 文件

webapi 位于放置根目录中,但也在显示的文件夹中。

我无法找到如何每次都清理整个放置文件夹,或者如何避免此错误。

更新 1:

在构建管道中,我可以在发布时看到:

##[section]Starting: Publish Artifact: webapidrops
==============================================================================
Task         : Publish Build Artifacts
Description  : Publish build artifacts to Azure Pipelines/TFS or a file share
Version      : 1.142.2
Author       : Microsoft Corporation
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkID=708390)
==============================================================================
##[section]Async Command Start: Upload Artifact
Uploading 31 files
Uploading 'webapidrops/2019_04/04_06_58/LuloWebApi.zip' (16%)
Uploading 'webapidrops/LuloWebApi.zip' (16%)
Uploading 'webapidrops/LuloWebApi.zip' (33%)
Uploading 'webapidrops/LuloWebApi.zip' (50%)
Uploading 'webapidrops/LuloWebApi.zip' (66%)
Uploading 'webapidrops/LuloWebApi.zip' (83%)
Uploading 'webapidrops/LuloWebApi.zip' (100%)
File upload succeed.
Upload 'D:\a\1\a' to file container: '#/1483345/webapidrops'
Associated artifact 387 with build 125
##[section]Async Command End: Upload Artifact
##[section]Finishing: Publish Artifact: webapidrops

【问题讨论】:

    标签: msbuild azure-devops azure-pipelines


    【解决方案1】:

    zip 文件来自您的构建管道。如果您只需要 LuloWebApi.zip,请将您的构建管道发布工件任务配置为仅使用此文件。

    如果您还需要发布版本的第二个 zip,那么您可以在发布中指定 LuloWebApi.zip:

    $(System.DefaultWorkingDirectory)/**/LuloWebApi.zip
    

    或者,您提到 zip 也存在于日期文件夹中,因此请指定此文件夹:

    $(System.DefaultWorkingDirectory)/**/**/*.zip
    

    【讨论】:

    • 第二个选项不起作用,我还有这个:多个包与指定模式匹配:D:\a\r1\a*****.zip。请限制搜索模式。
    • 你需要所有的 zip 文件吗?
    • 我只需要那个 ZIP 文件,有没有办法只发布那个文件?
    • 这是我在发布管道上发布到天蓝色的操作,我已经尝试了那里的所有模式组合,有时它说有多个 zip 文件,有时它说它找不到文件。 ..screencast.com/t/6rgZI4b0be
    • 在您的版本中,尝试删除一个/** ($(...)/**/LuloWebApi.zip)
    【解决方案2】:

    我的问题是我在同一个解决方案中有一个 MVC 项目和一个 API 项目 - 创建一个 POC。 我删除了 MVC 项目(通过 Visual Studio)。但是,物理文件仍然是源代码控制的一部分。

    在部署(通过 Azure DevOps)时,它仍然将这两个项目作为工件的一部分并引发了该错误。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-01-18
      • 1970-01-01
      • 1970-01-01
      • 2021-09-24
      • 2021-02-10
      • 1970-01-01
      相关资源
      最近更新 更多