title: Jenkins + maven Cargo + 2 tomcats
body: <p>I am building war file by Jenkins with maven and i need to deploy it to the 2 running tomcats at the same time. I wrote two profiles(for each tomcat) in the <em>pom.xml</em>, but when i run</p>
  
  <pre><code>cargo:deploy -Pprofile1,profile2
  </code></pre>
  
  <p>its deploying only to profile2. So i need to run command 2 times:</p>
  
  <pre><code>cargo:deploy -Pprofile1 
  cargo:deploy -Pprofile2
  </code></pre>
  
  <p>thats how my <em>pom.xml</em> looks:</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;version&gt;1.4.8&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;container&gt;
                      &lt;containerId&gt;tomcat7x&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.remote.uri&gt;${cargo.manager.url}&lt;/cargo.remote.uri&gt; 
                          &lt;cargo.remote.username&gt;${cargo.username}&lt;/cargo.remote.username&gt;
                          &lt;cargo.remote.password&gt;${cargo.password}&lt;/cargo.remote.password&gt;
                      &lt;/properties&gt; 
                  &lt;/configuration&gt;
                  &lt;deployables&gt;
                      &lt;deployable&gt;
                          &lt;groupId&gt;com.softserveinc&lt;/groupId&gt;
                          &lt;artifactId&gt;oms&lt;/artifactId&gt;
                          &lt;!-- &lt;version&gt;1.0.0-BUILD-SNAPSHOT&lt;/version&gt; --&gt;
                          &lt;type&gt;war&lt;/type&gt;
                      &lt;/deployable&gt;
                  &lt;/deployables&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;       
      &lt;/plugins&gt;
  &lt;/build&gt;
  &lt;profiles&gt;
      &lt;profile&gt;
          &lt;id&gt;profile1&lt;/id&gt;
              &lt;properties&gt;
              &lt;cargo.manager.url&gt;http://&lt;here shuold be ip addres&gt;/manager/text&lt;/cargo.manager.url&gt;
              &lt;cargo.username&gt;admin&lt;/cargo.username&gt;
              &lt;cargo.password&gt;admin&lt;/cargo.password&gt;
         &lt;/properties&gt;
      &lt;/profile&gt;
      &lt;profile&gt;
          &lt;id&gt;profile2&lt;/id&gt;
          &lt;properties&gt;
              &lt;cargo.manager.url&gt;http://&lt;here shuold be ip addres&gt;/manager/text&lt;/cargo.manager.url&gt;
              &lt;cargo.username&gt;admin&lt;/cargo.username&gt;
              &lt;cargo.password&gt;admin&lt;/cargo.password&gt;
          &lt;/properties&gt;
      &lt;/profile&gt;
  &lt;/profiles&gt;
  </code></pre>
  
  <p>but i need to do it for 2 tomcats by 1 command? someone know how to do it?</p>