title: Executing cargo:run from a maven profile
body: <p>I am trying to write a maven <code>profile</code> that will run the <code>cargo:run</code> <code>goal</code> and will Start a container and wait for the user to press <code>CTRL + C</code> to stop. However when I run <code>mvn clean install -PstartApplication</code>, the command completes successfully without waiting. What am I missing? </p>
  
  <pre><code>&lt;profile&gt;
     &lt;id&gt;startApplication&lt;/id&gt;
     &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;configuration&gt;
                 &lt;wait&gt;true&lt;/wait&gt;
                 &lt;container&gt;
                    &lt;containerId&gt;tomcat7x&lt;/containerId&gt;
                    &lt;type&gt;installed&lt;/type&gt;
                    &lt;home&gt;${catalina.home}&lt;/home&gt;
                 &lt;/container&gt;
                 &lt;configuration&gt;
                    &lt;type&gt;standalone&lt;/type&gt;
                    &lt;home&gt;${project.basedir}/target/tomcat7x&lt;/home&gt;
                 &lt;/configuration&gt;
                 &lt;deployables&gt;
                    &lt;deployable&gt;
                       &lt;properties&gt;
                          &lt;context&gt;ROOT&lt;/context&gt;
                       &lt;/properties&gt;
                       &lt;groupId&gt;com.demo.web&lt;/groupId&gt;
                       &lt;artifactId&gt;sample-web-app&lt;/artifactId&gt;
                       &lt;type&gt;war&lt;/type&gt;
                    &lt;/deployable&gt;
                 &lt;/deployables&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;run&lt;/goal&gt;
                       &lt;/goals&gt;
                    &lt;/execution&gt;
                 &lt;/executions&gt;
              &lt;/configuration&gt;
           &lt;/plugin&gt;
        &lt;/plugins&gt;
     &lt;/build&gt;
  &lt;/profile&gt;
  </code></pre>