title: tomcat-maven-plugin: Server returned HTTP response code: 403
body: <p>I'm trying to automatically deploy a Maven webapp from Eclipse Java EE to my local Tomcat server. I'm using Windows XP. This is the error:</p>
  
  <pre><code>[ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:deploy (default-cli) on project practicaIW: Cannot invoke Tomcat manager: Server returned HTTP response code: 403 for URL: http://127.0.0.1:8080/manager/deploy?path=%2Fpractica-3&amp;war= -&gt; [Help 1]
  </code></pre>
  
  <p>I think I know the reason of this error:</p>
  
  <ul>
  <li>If I run the Tomcat server inside eclipse, 127.0.0.1:8080 is my workspace/target. There is any manager folder and rest of classes on it, so it does not work. Possible botched solution: copy this folder and files inside my project.</li>
  <li>If I run the Tomcat server outside eclipse, 127.0.0.1:8080 is tomcat_location/webapps. It does not work because Eclipse creates the war file in my workspace so Tomcat cannot find it. Possible solution: <strong>configure the maven-war-plugin to create the war file into 127.0.0.1:8080. How could I do it?</strong> Is it the best way to procceed?</li>
  </ul>
  
  <p>pom.xml extract:</p>
  
  <pre><code> &lt;plugin&gt;
      &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
      &lt;artifactId&gt;tomcat-maven-plugin&lt;/artifactId&gt;
      &lt;configuration&gt;
          &lt;url&gt;http://127.0.0.1:8080/manager&lt;/url&gt;
          &lt;username&gt;admin&lt;/username&gt;
          &lt;password&gt;password&lt;/password&gt;
          &lt;server&gt;TomcatServer&lt;/server&gt;
          &lt;path&gt;/practica-3&lt;/path&gt;
      &lt;/configuration&gt;
   &lt;/plugin&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>  &lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
      &lt;version&gt;2.3&lt;/version&gt;
      &lt;configuration&gt;
         &lt;warSourceDirectory&gt;WebContent&lt;/warSourceDirectory&gt;
         &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
      &lt;/configuration&gt;
    &lt;/plugin&gt;
  </code></pre>
  
  <p>tomcat-users.xml extract:</p>
  
  <pre><code>&lt;tomcat-users&gt;
      &lt;role rolename="manager"/&gt;
      &lt;role rolename="manager-gui"/&gt;        
      &lt;role rolename="admin"/&gt;
      &lt;role rolename="manager-script"/&gt;
      &lt;user password="password" roles="admin,manager,manager-gui,manager-script" username="admin"/&gt;
  &lt;/tomcat-users&gt;
  </code></pre>
  
  <hr>
  
  <p><strong>UPDATE</strong>: 
  pvm14 answered the question. But previously you have to open the file: Tomcat v7.0 Server at localhost.server. Here is how:</p>
  
  <ol>
  <li>Properties</li>
  <li>Clicking on Switch location, the file that the arrow 3 indicate will appear.</li>
  <li>Open the file
  <img src="https://i.stack.imgur.com/b6P3f.jpg" alt="enter image description here"></li>
  </ol>