title: Maven: How do I deploy my WAR file to a remote Tomcat server?
body: <p>I'm using Maven 3.0.3.  I want to deploy my WAR file to a remote Tomcat 6 server, running the Tomcat manager app, in the verify phase of my project.  How can I do that?  I thought the Cargo plugin was the key to salvation but when I added this to my pom.xml file ...</p>
  
  <pre><code>        &lt;plugin&gt;
              &lt;groupId&gt;org.codehaus.cargo&lt;/groupId&gt;
              &lt;artifactId&gt;cargo-maven2-plugin&lt;/artifactId&gt;
              &lt;configuration&gt;
                  &lt;container&gt;
                      &lt;containerId&gt;tomcat${tomcat.major}x&lt;/containerId&gt;
                      &lt;zipUrlInstaller&gt;
                          &lt;url&gt;http://archive.apache.org/dist/tomcat/tomcat-${tomcat.major}/v${tomcat.version}/bin/apache-tomcat-${tomcat.version}.tar.gz&lt;/url&gt;
                          &lt;downloadDir&gt;${project.build.directory}/downloads&lt;/downloadDir&gt;
                          &lt;extractDir&gt;${project.build.directory}/extracts&lt;/extractDir&gt;
                      &lt;/zipUrlInstaller&gt;
                      &lt;output&gt;${project.build.directory}/tomcat${tomcat.major}x.log&lt;/output&gt;
                      &lt;log&gt;${project.build.directory}/cargo.log&lt;/log&gt;
                  &lt;/container&gt;
                  &lt;configuration&gt;
                      &lt;home&gt;${project.build.directory}/tomcat-${tomcat.version}/container&lt;/home&gt;
                      &lt;properties&gt;
                          &lt;cargo.logging&gt;high&lt;/cargo.logging&gt;
                          &lt;cargo.servlet.port&gt;${tomcat.servlet.port}&lt;/cargo.servlet.port&gt;
                          &lt;cargo.tomcat.ajp.port&gt;${tomcat.ajb.port}&lt;/cargo.tomcat.ajp.port&gt;
                      &lt;/properties&gt;
                  &lt;/configuration&gt;
              &lt;/configuration&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;start-container&lt;/id&gt;
                      &lt;phase&gt;pre-integration-test&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;start&lt;/goal&gt;
                          &lt;goal&gt;deploy&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                          &lt;deployer&gt;
                              &lt;deployables&gt;
                                  &lt;deployable&gt;
                                      &lt;groupId&gt;${project.groupId}&lt;/groupId&gt;
                                      &lt;artifactId&gt;${project.artifactId}&lt;/artifactId&gt;
                                      &lt;type&gt;war&lt;/type&gt;
                                      &lt;pingURL&gt;http://localhost:${tomcat.servlet.port}/${project.artifactId}&lt;/pingURL&gt;
                                      &lt;pingTimeout&gt;30000&lt;/pingTimeout&gt;
                                      &lt;properties&gt;
                                          &lt;context&gt;${project.artifactId}&lt;/context&gt;
                                      &lt;/properties&gt;
                                  &lt;/deployable&gt;
                              &lt;/deployables&gt;
                          &lt;/deployer&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
                  &lt;execution&gt;
                      &lt;id&gt;stop-container&lt;/id&gt;
                      &lt;phase&gt;post-integration-test&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;stop&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
                  &lt;!--  In the verify phase, deploy the app to a Tomcat instance.  We
                        require that the properties "tomcat.manager.url", "tomcat.username", and
                        "tomcat.password" be defined. 
                   --&gt;
                  &lt;execution&gt;
                      &lt;id&gt;deploy-to-remote-tomcat&lt;/id&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;deploy&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;phase&gt;verify&lt;/phase&gt;
                      &lt;configuration&gt;
                          &lt;container&gt;
                              &lt;containerId&gt;tomcat${tomcat.major}x&lt;/containerId&gt;
                              &lt;type&gt;remote&lt;/type&gt;
                          &lt;/container&gt;
                          &lt;configuration&gt;
                              &lt;type&gt;runtime&lt;/type&gt;
                              &lt;properties&gt;
                                  &lt;cargo.tomcat.manager.url&gt;${tomcat.manager.url}&lt;/cargo.tomcat.manager.url&gt;
                                  &lt;cargo.remote.username&gt;${tomcat.username}&lt;/cargo.remote.username&gt;
                                  &lt;cargo.remote.password&gt;${tomcat.password}&lt;/cargo.remote.password&gt;
                              &lt;/properties&gt;
                          &lt;/configuration&gt;
                          &lt;deployer&gt;
                              &lt;type&gt;remote&lt;/type&gt;
                              &lt;deployables&gt;
                                  &lt;deployable&gt;
                                      &lt;groupId&gt;${project.groupId}&lt;/groupId&gt;
                                      &lt;artifactId&gt;${project.artifactId}&lt;/artifactId&gt;
                                      &lt;type&gt;${project.packaging}&lt;/type&gt;
                                  &lt;/deployable&gt;
                              &lt;/deployables&gt;
                          &lt;/deployer&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt; 
              &lt;/executions&gt;
          &lt;/plugin&gt;
  </code></pre>
  
  <p>I get the error</p>
  
  <pre><code>Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.1.3:redeploy (deploy-to-remote-tomcat) on project myco-productplus-web: Execution deploy-to-remote-tomcat of goal org.codehaus.cargo:cargo-maven2-plugin:1.1.3:redeploy failed: Failed to create deployer with implementation class org.codehaus.cargo.container.tomcat.Tomcat6xRemoteDeployer for the parameters (container [id = [tomcat6x]], deployer type [remote]). argument type mismatch -&gt; [Help 1]
  </code></pre>
  
  <p>Thanks for any suggestions, - Dave</p>