简体   繁体   English

Azure DevOps 工件

[英]Azure DevOps Artifacts

I am new to Azure DevOps (Hosted Agent) and am trying to use the Azure Pipelines to build my Java web app using Ant我是 Azure DevOps(托管代理)的新手,正在尝试使用 Azure Pipelines 使用 Ant 构建我的 Java Web 应用程序

below is the pipeline file下面是管道文件

trigger:
- azure-pipelines

pool:
  vmImage: 'ubuntu-latest'

steps:
- task: Ant@1
  inputs:
    workingDirectory: ''
    buildFile: 'ant/build.xml'
    javaHomeOption: 'JDKVersion'
    jdkVersionOption: '1.8'
    jdkArchitectureOption: 'x64'
    publishJUnitResults: true
    testResultsFiles: '**/TEST-*.xml'

Project got build successfully but the path of the WAR file is shown as项目构建成功,但WAR文件的路径显示为

Building war: /home/vsts/work/1/s/war/Project.war建筑战争:/home/vsts/work/1/s/war/Project.war

I am not able find /home/vsts/work/1/s path in Azure DevOps, I tried to search under Artifact but not found, How can I access the /home/vsts/work/1/s so that I can get my WAR file?我无法在 Azure DevOps 中找到/home/vsts/work/1/s路径,我尝试在 Artifact 下搜索但未找到,如何访问/home/vsts/work/1/s以便我可以得到我的WAR文件?

You need to use Publish Artifact task in order to be able to obtain the results of your build.您需要使用Publish Artifact任务才能获得构建结果。

- task: PublishBuildArtifacts@1
  inputs:
    pathtoPublish: '$(Build.ArtifactStagingDirectory)' # or your build results directory 
    artifactName: 'drop' 
    #publishLocation: 'Container' # Options: container, filePath
    #targetPath: # Required when publishLocation == FilePath
    #parallel: false # Optional
    #parallelCount: # Optional
    #fileCopyOptions: #Optional

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM