title: Maven Tomcat Plugin - specify destincation for war?
body: <p>I'm running <strong>mvn tomcat:deploy</strong> in order to try and deploy a war file that I want to run on a virtual host in Tomcat 7.0.8. I've verified that the virual host is working ok, and have also copied across the manager application to the virtual host.</p>
  
  <p>Having updated my pom to point at my new virtual host, when I run mvn tomcat:reploy it doesn't put my war file in to the correct folder. It always seems to put it in the <strong>webapps</strong> folder. If I then copy the war across to the folder that I setup for my virtual host then it works, but it won't do this automatically.</p>
  
  <p>Am I missing a confiuration option? Is there a <strong>warDestination</strong> setting or something similar?</p>
  
  <p>For reference, here's a snippet from my pom.xml:</p>
  
  <pre><code>&lt;build&gt;
      &lt;plugins&gt;
          &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://myvhost.local:8080/manager/html&lt;/url&gt;
                  &lt;server&gt;myvhost&lt;/server&gt;
                  &lt;path&gt;/&lt;/path&gt;
               &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>and the relevant snippet from my settings.xml:</p>
  
  <pre><code>&lt;servers&gt;
      &lt;server&gt;
          &lt;id&gt;myvhost&lt;/id&gt;
          &lt;username&gt;testing&lt;/username&gt;
          &lt;password&gt;testing&lt;/password&gt;
      &lt;/server&gt;
  &lt;/servers&gt;
  </code></pre>
  
  <p><strong>UPDATE:</strong> I resolved this issue by changing the plugin I was using to the following:</p>
  
  <pre><code>&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.0-beta-1&lt;/version&gt;
      &lt;configuration&gt;
          &lt;url&gt;http://myvhost.local:8080/manager/html&lt;/url&gt;
          &lt;server&gt;myvhost&lt;/server&gt;
          &lt;path&gt;/&lt;/path&gt;
      &lt;/configuration&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>I then tried running <strong>mvn tomcat7:deploy</strong> but found I had to add the following to my <strong>settings.xml</strong> in order for the <strong>tomcat7</strong> prefix to be recognised:</p>
  
  <pre><code>&lt;pluginGroups&gt;
      &lt;pluginGroup&gt;org.apache.tomcat.maven&lt;/pluginGroup&gt;
  &lt;/pluginGroups&gt;
  </code></pre>
  
  <p>I can now deploy to my vhost by running <strong>mvn tomcat7:deploy</strong> - unfortunately I can't see a way of redeploying a war that's already been deployed as I could with the previous plugin....I'll keep searching though.</p>
  
  <p><strong>UPDATE:</strong> It looks like the ability to redeploy is in the <strong>2.0-SNAPSHOT</strong> version of the <strong>tomcat7-maven-plugin</strong> plugin but not the <strong>2.0-beta-1</strong> version that's in the repository. Hopefully that'll be released soon.</p>
  
  <p>Thanks,</p>
  
  <p>James.</p>