steps:
  - publish: $(System.DefaultWorkingDirectory)
    condition: or(eq(variables['CaptureRepositoryOnFailure'], 'true'), and(failed(), eq(variables['Build.Reason'],'Schedule')))
    displayName: 'Capture repo state for analysis'
    artifact: repository-$(System.JobName)

  - task: PowerShell@2
    displayName: Clean up maven local cache
    inputs:
      pwsh: true
      filePath: $(Build.SourcesDirectory)/eng/scripts/Remove-Azure-Artifacts-From-Cache.ps1
      arguments: >
        -MavenCacheFolder $(MAVEN_CACHE_FOLDER)
    continueOnError: true
