0
votes

I am new to Azure DevOps (Hosted Agent) and am trying to use the Azure Pipelines to build my Java web app using Ant

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

Building 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?

1

1 Answers

2
votes

You need to use Publish Artifact task in order to be able to obtain the results of your build.

- 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