401 (Unauthorized) error while using maven to deploy war to remote Tomcat 8

前端 未结 2 1749
既然无缘
既然无缘 2021-01-16 23:18

I am trying to deploy a war on remote Tomcat 8 but getting 401 (Unauthorized) error in the process.

Error Log

[ERROR] Tomcat return http status err         


        
相关标签:
2条回答
  • 2021-01-16 23:27

    In case this helps someone in the future, I discovered that Tomcat would return a 401 if the password in tomcat-users.xml started with a number instead of letter. This was only the case when trying to do the deploy via curl or via GitLab using cargo maven plugin. (it worked fine running the maven deploy from within Eclipse).

    Changing the password to start with a letter fixed things for curl and when deploying from GitLab

    0 讨论(0)
  • 2021-01-16 23:32

    You need to define the credentials for your "integration-tomcat" server; this is normally done in your ~/.m2/settings.xml file:

    <servers>
      <server>
        <id>integration-tomcat</id>
        <username>manager</username>
        <password>manager</password>
      </server>
    </servers>
    
    0 讨论(0)
提交回复
热议问题