3
votes

From the MS docs: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/maven?view=azure-devops

mavenFeedAuthenticate Authenticate built-in Maven feeds (Required) Automatically authenticate Maven feeds from Azure Artifacts. If built-in Maven feeds are not in use, deselect this option for faster builds. Default value: false Argument aliases: mavenAuthenticateFeed

But everytime I want to use a Maven feeds from Azure Artifacts and I try this by setting mavenFeedAuthenticate to true I always get 401 (Unauthorized).

Could someone please show me the correct usage of this value?

1

1 Answers

1
votes

Please refer to this doc to check if you have given Contributor/Owner role to identities: Project Collection Build Service ({OrgName}) and {Project Name} Build Service ({Org Name}) as this doc described.

In addition, this mavenFeedAuthenticate argument in the Maven task is set to false by default, which means that Azure Pipelines will automatically authenticate Maven feeds from Azure Artifacts in the backend. But if it is set to true, we need to specify PAT with full scopes in settings.xml and add file path pointing to this settings.xml for authentication in Options menu in this Maven task.