title: 401 (Unauthorized) error while using maven to deploy war to remote Tomcat 8
body: <p>I am trying to deploy a war on remote Tomcat 8 but getting 401 (Unauthorized) error in the process.</p>
  
  <h1>Error Log</h1>
  
  <pre><code>[ERROR] Tomcat return http status error: 401, Reason Phrase: Unauthorized
  </code></pre>
  
  <h1>Command executed for deployment</h1>
  
  <pre><code>mvn tomcat7:redeploy
  </code></pre>
  
  <h1>pom.xml</h1>
  
  <pre><code>&lt;properties&gt;
      &lt;integration.tomcat.url&gt;http://gsi-547576:8080/manager/text&lt;/integration.tomcat.url&gt;
  &lt;/properties&gt;
  
  &lt;!-- Deploy to Remote Tomcat --&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.tomcat.maven&lt;/groupId&gt;
              &lt;artifactId&gt;tomcat7-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.2&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;url&gt;${integration.tomcat.url}&lt;/url&gt;
                  &lt;server&gt;integration-tomcat&lt;/server&gt;
                  &lt;path&gt;/${project.artifactId}&lt;/path&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
  </code></pre>
  
  <h1>tomcat-users.xml</h1>
  
  <pre><code>&lt;role rolename="tomcat" /&gt;
  &lt;role rolename="manager-gui" /&gt;
  &lt;role rolename="manager-script" /&gt;
  &lt;role rolename="admin-gui" /&gt;
  &lt;user username="manager" password="manager" roles="tomcat,manager-gui,admin-gui,manager-script" /&gt;
  </code></pre>
  
  <p>Please guide.</p>