title: How to run embedded Tomcat 9 inside Maven 3 for integration testing purposes?
body: <p>I am trying to run embedded Tomcat 9 inside Maven 3 for integration testing purposes. I was led to <code>cargo-maven2-plugin</code> by other SO answers.</p>
  
  <p>So, attempting to follow the instructions found here:</p>
  
  <blockquote>
    <p><a href="https://codehaus-cargo.github.io/cargo/Static+deployment+of+WAR.html" rel="nofollow noreferrer">https://codehaus-cargo.github.io/cargo/Static+deployment+of+WAR.html</a></p>
  </blockquote>
  
  <p>I have this fragment in a simple POM:</p>
  
  <pre><code>&lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.codehaus.cargo&lt;/groupId&gt;
              &lt;artifactId&gt;cargo-maven2-plugin&lt;/artifactId&gt;
              &lt;version&gt;1.7.6&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;container&gt;
                      &lt;containerId&gt;tomcat9x&lt;/containerId&gt;
                      &lt;type&gt;embedded&lt;/type&gt;
                  &lt;/container&gt;
                  &lt;deployables&gt;
                      &lt;deployable&gt;
                          &lt;type&gt;war&lt;/type&gt;
                          &lt;properties&gt;
                              &lt;file&gt;path/to/myapp.war&lt;/file&gt;
                          &lt;/properties&gt;
                      &lt;/deployable&gt;
                  &lt;/deployables&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>Which I try to execute with <code>mvn org.codehaus.cargo:cargo-maven2-plugin:run</code></p>
  
  <p>It fails with the error:</p>
  
  <blockquote>
    <p>[INFO] [en2.ContainerRunMojo] Resolved container artifact
    org.codehaus.cargo:cargo-core-container-tomcat:jar:1.7.6 for container
    tomcat9x [WARNING] The defined deployable has the same groupId and
    artifactId as your project's main artifact but the type is different.
    You've defined a [war] type wher eas the project's packaging is [pom].
    This is possibly an error and as a consequence the plugin will try to
    find this deployable in the project's dependencies.</p>
  </blockquote>
  
  <p>How can I make this work? I just want to launch the given WAR in an embedded tomcat9, from within Maven.</p>