Why am I getting a “401 Unauthorized” error in Maven?

前端 未结 21 1838
栀梦
栀梦 2020-11-29 18:06

Why am I getting a \"401 Unauthorized\" error in Maven?

Here\'s the error I\'m getting when calling mvn deploy (full logs at the bottom):

21条回答
  •  感动是毒
    2020-11-29 18:23

    I got the same error when trying to deploy to a Artifactory repository, the following solved the issue for me:

    Go to the repository setting in artifactory and enable the point "Force Maven Authentication" and the 401 "Unauthorized" error should be gone. (Of course you need to supply your credentials in the settings.xml file at best in plain text to prevent issues)

    I guess by default, even through you supply the right credentials in the settings.xml file, they don't get used and you get the Unauthorized exception.

提交回复
热议问题