Hi,
In the docs, I noticed that it is recommended to copy build output to Build.ArtifactStagingDirectory using CopyFiles@2 and publish using PublishBuildArtifacts@1 from Build.ArtifactStagingDirectory. Could you please explain why this step is recommended? Is there anything wrong if I directly publish from the Sources Directory. For example, if it is a maven build, my build output will be in the "target" folder $(build.sourcesDirectory)/target. I was thinking about publishing it from $(build.sourcesDirectory)/target and skipping the CopyTask?
Thanks,
Ciju
You can absolutely publish from any directory you want. In fact we are likely to adjust our guidance here in light of our new artifact type (Pipeline Artifacts) which is more efficient that the current Publish Build Artifacts task.
That said - if you are producing Maven artifacts you should consider using Azure Artifacts - we have a Maven package hosting feed.
Thanks, Mitch! I hope this helps @cijujoseph :) Going to close this now as I think the answer is ultimately yes, you can publish from any directory you like!
thanks!