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

前端 未结 21 1795
栀梦
栀梦 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

    In my case I removed the server logon credentials for central from my setting.

         
            central
            admin 
            ****** 
        
    
       
            central
            central
            maven-central
            http://www.localhost:8081/repository/maven-central/
        
    

    I don't know why I did that, but its completely wrong since the central maven repo can be accessed anonymously. See my debug output that led to my error identification and resolution.

    [DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for http://www.localhost:8081/repository/maven-central/ with username=admin, password=***
    

提交回复
热议问题